Repeating String
Time limit2sMemory limit1024 MB
Given a string of length N, the task is to check whether its first half equals its second half and print Yes or No.
- Level
Easy1 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Writing the same string twice in a row gives a repeating string.
For example, OIOI, JJJJJJ, and JOIOIJOIOI are repeating strings, but IOOI and JOIIOI are not.
You are given a string S of length N. N is even, and each character of S is J, O, or I.
If S is a repeating string, print Yes. Otherwise, print No.
Input
Input is given from Standard Input in the following format.
N
S
Output
If S is a repeating string, print Yes. Otherwise, print No.
Constraints
2 ≦ N ≦ 100.Nis even.Sis a string of lengthN.- Each character of
SisJ,O, orI.