Given a string, determine if it can be partitioned into two nonempty substrings, both of which are palindromes.
Constraints
The only letters that appear are a
and b
.
Input Specification
The input consists of a single string of length .
Output Specification
If the string can be partitioned into two nonempty substrings, both of which are palindromes, output YES
.
Output NO
otherwise.
Sample Input 1
a
Sample Output 1
NO
Sample Input 2
aa
Sample Output 2
YES
Comments