#K94442. Even Reversal Palindrome Transformation

    ID: 38642 Type: Default 1000ms 256MiB

Even Reversal Palindrome Transformation

Even Reversal Palindrome Transformation

Given a string s, determine whether it is possible to transform s into a palindrome by reversing any of its even-length substrings any number of times. The underlying idea is that, with the allowed operation, the necessary and sufficient condition for the transformation is equivalent to checking if the characters of s can be rearranged to form a palindrome.

A palindrome is a string that reads the same backward as forward. In particular, if we denote the frequency of a character c by \(f(c)\), then the condition for a string to have a palindromic permutation is:

[ \sum_{c \in \Sigma} \mathbb{1}(f(c) % 2 = 1) \le 1 ]

Here, \(\mathbb{1}(P)\) is the indicator function that is 1 if the predicate \(P\) is true, and 0 otherwise.

inputFormat

The input consists of a single line containing the string s which comprises only ASCII characters.

outputFormat

Output a single line: YES if it is possible to transform s into a palindrome using the allowed operations, and NO otherwise.

## sample
abba
YES

</p>