atcoder#ABC232B. [ABC232B] Caesar Cipher

[ABC232B] Caesar Cipher

Score : 200200 points

Problem Statement

Takahashi has a string SS consisting of lowercase English letters.

On this string, he will do the operation below just once.

  • First, choose a non-negative integer KK.
  • Then, shift each character of SS to the right by KK (see below).

Here,

  • a shifted to the right by 11 is b;
  • b shifted to the right by 11 is c;
  • c shifted to the right by 11 is d;
  • \cdots
  • y shifted to the right by 11 is z;
  • z shifted to the right by 1 is a.

For example, b shifted to the right by 44 is f, and y shifted to the right by 33 is b.

You are given a string TT. Determine whether Takahashi can make SS equal TT by the operation above.

Constraints

  • Each of SS and TT is a string of length between 11 and 10510^5 (inclusive) consisting of lowercase English letters.
  • The lengths of SS and TT are equal.

Input

Input is given from Standard Input in the following format:

SS

TT

Output

If Takahashi can make SS equal TT, print Yes; if not, print No.

abc
ijk
Yes

When Takahashi chooses K=8K=8,

  • a is shifted to the right by 88 and becomes i,
  • b is shifted to the right by 88 and becomes j,
  • c is shifted to the right by 88 and becomes k,

and now SS and TT are equal. Therefore, he can make SS equal TT, so Yes should be printed.

z
a
Yes

Choosing K=1K=1 makes SS and TT equal. Note that the letter on the right of z is a.

ppq
qqp
No

There is no non-negative integer KK that he can choose to make SS equal TT, so No should be printed.

atcoder
atcoder
Yes

Choosing K=0K=0 makes SS and TT equal.