Mock CCC '18 Contest 3 J2 - A Palindrome Problem

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

Given a string, determine if it can be partitioned into two nonempty substrings, both of which are palindromes.

Constraints

1 \le N \le 8

The only letters that appear are a and b.

Input Specification

The input consists of a single string of length N.

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

There are no comments at the moment.