#K58027. Check Rotated String
Check Rotated String
Check Rotated String
You are given two strings s1 and s2. Your task is to determine if s2 is a rotated version of s1. A rotated version means that there exists some rotation such that s2 can be found as a substring of the concatenation of s1 with itself.
In mathematical terms, if we define the concatenated string as \( s1 + s1 \), then if \( s2 \) is a substring of \( s1+s1 \) (and the lengths of s1 and s2 are equal), output "YES"; otherwise, output "NO".
For example, if s1 = "hello" and s2 = "lohel", then the answer is "YES".
inputFormat
The input consists of exactly two lines. The first line contains the string s1 and the second line contains the string s2.
outputFormat
Output a single line with "YES" if s2 is a rotated version of s1; otherwise, output "NO".
## sampleabc
abc
YES