Tell whether a given string is super-string or not

A string of length n is called super-string if among all possible substrings of the given string, exactly n-1 substrings are non-palindrome and else all are palindrome. Given a string as input, tell whether the given string is a super-string or not.

Input Format

A string containing only lowercase english alphabets.

Constraints

1 <= |length of string| <= 100000

Output Format

Output YES if the given string is a super-string and NO otherwise.

Author: gg_14
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer