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
Copy
a
Sample Output 1
Copy
NO
Sample Input 2
Copy
aa
Sample Output 2
Copy
YES
Comments