Cyclic k-extension#2199

Cyclic k-extension

1 second
64 megabytes
Medium

Vasya recently learned about the concept of a cyclic -extension of a string . This is created by concatenating copies of the string , and then taking the first characters of the concatenated result.

After learning this, Vasya became excited and began applying this operation to a string, without remembering which he used each time.

You are given a part of the sequence that Vasya obtained. Your task is to determine if Vasya could have made a mistake in his complex transformations, that is, to check whether it is possible to obtain a result containing the given substring from the initial string.

Input

The first line contains the initial string that Vasya carefully wrote down before starting his actions. The second line contains the substring of the result that Vasya obtained. Both strings are non-empty and have a length not exceeding . The strings may contain uppercase and lowercase Latin letters (case-sensitive) and digits.

Output

Print "NO" if you can definitely say that Vasya made a mistake, or "YES" if it is possible that he did not make a mistake.

Examples

Example 1

Loading
Loading