Periodic String
Time limit2sMemory limit2048 MB
Given a string S of length N, the task is to check whether S is some string T repeated at least twice, printing Yes or No.
- Level
Easy2 of 10
- Topics
- String, Brute force
- Solved
- No attempts yet
Problem
A string of length is given. Each character of is a lowercase English letter.
If there exist a string and an integer () such that concatenating times in order gives , then is called periodic.
Print Yes if is periodic, and No otherwise.
Input
The input is given in the following format.
N
S
Output
Print Yes if is periodic, and No otherwise. Print nothing other than the answer, including no prompts for input.
Constraints
- .
- is a string of length .
- Each character of is a lowercase English letter.
- is an integer.