LogiQuest

97. Is It a Rotation?

EasyString

Print YES if string b can be obtained by rotating string a (moving some prefix to the end), else NO.

Input format

Line 1: a Line 2: b

Output format

YES or NO

Example 1

Input

waterbottle
erbottlewat

Output

YES

Example 2

Input

abc
acb

Output

NO

Constraints

1 ≤ |a|, |b| ≤ 10⁵

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…