6320: ABC232 —— B - Caesar Cipher
[Creator : ]
Description
Takahashi has a string $S$ consisting of lowercase English letters.
On this string, he will do the operation below just once.
You are given a string $T$. Determine whether Takahashi can make $S$ equal $T$ by the operation above.
On this string, he will do the operation below just once.
- First, choose a non-negative integer $K$.
- Then, shift each character of $S$ to the right by $K$ (see below).
- a shifted to the right by $1$ is b;
- b shifted to the right by $1$ is c;
- c shifted to the right by $1$ is d;
- $\cdots$
- y shifted to the right by $1$ is z;
- z shifted to the right by $1$ is a.
You are given a string $T$. Determine whether Takahashi can make $S$ equal $T$ by the operation above.
Input
Input is given from Standard Input in the following format:
$S$
$T$
$S$
$T$
Output
If Takahashi can make $S$ equal $T$, print Yes; if not, print No.
Constraints
Each of $S$ and $T$ is a string of length between $1$ and $10^5$ (inclusive) consisting of lowercase English letters.
The lengths of $S$ and $T$ are equal.
The lengths of $S$ and $T$ are equal.
Sample 1 Input
abc
ijk
Sample 1 Output
Yes
When Takahashi chooses $K=8$,
Sample 2 Input
z
a
Sample 2 Output
Yes
Choosing $K=1$.
Sample 3 Input
ppq
qqp
Sample 3 Output
No