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

1N8

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

Copy
a

Sample Output 1

Copy
NO

Sample Input 2

Copy
aa

Sample Output 2

Copy
YES

Comments

There are no comments at the moment.