#c22403. 循环同构判断

循环同构判断

Cyclic Isomorphism Check

Problem Description

You are given two strings aa and bb, consisting only of lowercase letters. Determine whether the two strings are cyclically isomorphic.

If yes, output Yes; otherwise output No.

Input Format

The first line contains a string aa.

The second line contains a string bb.

Output Format

Output one line with a string, the answer.

Sample Input 1

baabaac
cbaabaa

Sample Output 1

Yes

Sample Input 2

aaab
caaa

Sample Output 2

No

Constraints

For all data: 1≤∣a∣,∣b∣≤1051 \leq |a|, |b| \leq 10^5, and both strings consist only of lowercase letters.