100 atcoder#ABC159B. [ABC159B] String Palindrome
[ABC159B] String Palindrome
Score : points
Problem Statement
A string of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:
- is a palindrome.
- Let be the length of . The string formed by the -st through -th characters of is a palindrome.
- The string consisting of the -st through -th characters of is a palindrome.
Determine whether is a strong palindrome.
Constraints
- consists of lowercase English letters.
- The length of is an odd number between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
If is a strong palindrome, print Yes
;
otherwise, print No
.
akasaka
Yes
- is
akasaka
. - The string formed by the -st through the -rd characters is
aka
. - The string formed by the -th through the -th characters is
aka
. All of these are palindromes, so is a strong palindrome.
level
No
atcoder
No