/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 233 点
問題文
高橋君は、英小文字が 1 文字ずつ横一列に写っている長さ N のフィルムのネガを持っています。左から i 番目に写っている文字は文字列 S の i 文字目です。
高橋君はこのネガをちょうど真ん中で折り、左半分と右半分を重ねました。すると、重なった文字がすべて同じ文字でした。つまり、左から i 番目の文字と右から i 番目の文字が、すべての i について一致していました。
S がこの条件を満たすなら Yes を、満たさないなら No を出力してください。
制約
- 1 \leq N \leq 100
- S は英小文字のみからなる長さ N の文字列
入力
入力は以下の形式で標準入力から与えられる。
N S
- 1 行目には、文字数 N が与えられる。
- 2 行目には、ネガに写っている文字を表す文字列 S が与えられる。
出力
条件を満たすなら Yes を、満たさないなら No を 1 行で出力せよ。
入力例 1
5 abcba
出力例 1
Yes
入力例 2
4 abcd
出力例 2
No
入力例 3
1 a
出力例 3
Yes
入力例 4
21 zjioxfgenfeinrkjpivjj
出力例 4
No
入力例 5
68 nqnrbvytsioctxkixfdfyonotscmztxgbmxdswgmxwdnoqtnynfifgifjvswqhapjptq
出力例 5
No
Score : 233 pts
Problem Statement
Takahashi has a negative film of length N on which lowercase English letters are printed one character each in a horizontal row. The i-th character from the left is the i-th character of the string S.
Takahashi folded this negative exactly in the middle and overlapped the left half with the right half. Then, all the overlapping characters turned out to be the same. In other words, the i-th character from the left and the i-th character from the right coincided for every i.
If S satisfies this condition, print Yes; otherwise, print No.
Constraints
- 1 \leq N \leq 100
- S is a string of length N consisting only of lowercase English letters.
Input
The input is given from Standard Input in the following format:
N S
- The first line contains the number of characters N.
- The second line contains the string S representing the characters printed on the negative.
Output
Print Yes in one line if the condition is satisfied, and No otherwise.
Sample Input 1
5 abcba
Sample Output 1
Yes
Sample Input 2
4 abcd
Sample Output 2
No
Sample Input 3
1 a
Sample Output 3
Yes
Sample Input 4
21 zjioxfgenfeinrkjpivjj
Sample Output 4
No
Sample Input 5
68 nqnrbvytsioctxkixfdfyonotscmztxgbmxdswgmxwdnoqtnynfifgifjvswqhapjptq
Sample Output 5
No