7330: ABC237 —— C - kasaka
[Creator : ]
Description
Given is a string S consisting of lowercase English letters. Determine whether adding some number of a's (possibly zero) at the beginning of S can make it a palindrome.
Here, a string of length $N, A=A_1A_2\ldots A_N$, is said to be a palindrome when $A_i=A_{N+1-i}$ for every $1\leq i\leq N$.
Here, a string of length $N, A=A_1A_2\ldots A_N$, is said to be a palindrome when $A_i=A_{N+1-i}$ for every $1\leq i\leq N$.
Input
Input is given from Standard Input in the following format:
$S$
$S$
Output
If adding some number of a's (possibly zero) at the beginning of S can make it a palindrome, print Yes; otherwise, print No.
Constraints
$1≤∣S∣≤10^6$
S consists of lowercase English letters.
S consists of lowercase English letters.
Sample 1 Input
kasaka
Sample 1 Output
Yes
By adding one a at the beginning of kasaka, we have akasaka, which is a palindrome, so Yes should be printed.
Sample 2 Input
atcoder
Sample 2 Output
No
Adding any number of a's at the beginning of atcoder does not make it a palindrome.
Sample 3 Input
php
Sample 3 Output
Yes
php itself is a palindrome. Adding zero a's at the beginning of S is allowed, so Yes should be printed.