#K88482. String Rotation Check
String Rotation Check
String Rotation Check
Given two strings, determine whether the second string is a rotation of the first string. A string (s_2) is considered a rotation of (s_1) if it can be obtained by moving a set of consecutive characters from the beginning of (s_1) to its end. For example, if (s_1 = \texttt{waterbottle}), then (s_2 = \texttt{erbottlewat}) is a valid rotation since it is formed by moving the prefix (\texttt{wat}) to the end of (\texttt{erbottle}).
inputFormat
The input is provided via standard input (stdin) and consists of two lines. The first line contains the string (s_1), and the second line contains the string (s_2). Both strings consist of printable characters without spaces.
outputFormat
Print a single line to standard output (stdout) containing either "YES" if (s_2) is a rotation of (s_1), or "NO" otherwise.## sample
waterbottle
erbottlewat
YES