#K15806. String Rotation Equality Check
String Rotation Equality Check
String Rotation Equality Check
Given two strings (s_1) and (s_2), determine whether (s_1) can be rotated (cyclically shifted) so that it becomes (s_2). A rotation of a string means moving some prefix from the beginning of the string to the end without changing the order of the characters. For example, rotating "abcde" by 2 positions results in "cdeab", and rotating "abcde" by 3 positions results in "deabc".
Your task is to write a program that reads two strings from standard input and prints "Yes" if (s_2) is a rotation of (s_1) and "No" otherwise. Note that if the lengths of (s_1) and (s_2) are different, the answer is automatically "No".
inputFormat
The input consists of two lines. The first line contains the string (s_1) and the second line contains the string (s_2). Both strings can include alphabetic characters.
outputFormat
Output a single line containing either "Yes" if (s_2) is a rotation of (s_1), or "No" otherwise.## sample
abcde
deabc
Yes