#B4119. Cyclic String Check

    ID: 11776 Type: Default 1000ms 256MiB

Cyclic String Check

Cyclic String Check

Given a string \(S\) of length \(N\) consisting only of lowercase letters, determine whether there exists a non-empty string \(T\) such that when concatenated \(m\) times (with \(m \ge 2\)) it equals \(S\).

In other words, check if \(S = T^m\) for some \(m \ge 2\). If such a string \(T\) exists, output Yes, otherwise output No.

inputFormat

The input consists of a single line containing the string \(S\) (\(1 \le |S| \le 10^5\)), where \(S\) contains only lowercase letters.

outputFormat

Output a single line Yes if \(S\) is cyclic; otherwise, output No.

sample

aba
No