#abc103b. [abc103_b]String Rotation
[abc103_b]String Rotation
Problem Statement
You are given string and consisting of lowercase English letters.
Determine if equals after rotation.
That is, determine if equals after the following operation is performed some number of times:
Operation: Let . Change to .
Here, denotes the length of the string .
Constraints
- and consist of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
If equals after rotation, print Yes
; if it does not, print No
.
Sample Input 1
kyoto
tokyo
Sample Output 1
Yes
- In the first operation,
kyoto
becomesokyot
. - In the second operation,
okyot
becomestokyo
.
Sample Input 2
abc
arc
Sample Output 2
No
abc
does not equal arc
after any number of operations.
Sample Input 3
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab
Sample Output 3
Yes