79 atcoder#ABC103B. [ABC103B] String Rotation
[ABC103B] String Rotation
Score : points
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
.
kyoto
tokyo
Yes
- In the first operation,
kyoto
becomesokyot
. - In the second operation,
okyot
becomestokyo
.
abc
arc
No
abc
does not equal arc
after any number of operations.
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab
Yes