LogiQuest

121. Repeated Substring Pattern

EasyString

Print YES if s can be built by repeating one of its substrings two or more times, else NO.

Input format

A single line.

Output format

YES or NO

Example 1

Input

abab

Output

YES

Example 2

Input

aba

Output

NO

Constraints

1 ≤ |s| ≤ 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…