#C2696. Can Form Palindrome

    ID: 46040 Type: Default 1000ms 256MiB

Can Form Palindrome

Can Form Palindrome

Given a string ( S ) consisting of lowercase alphabets, determine if the characters in ( S ) can be rearranged to form a palindrome. A necessary and sufficient condition for this is that at most one character has an odd frequency. In mathematical terms, if ( \text{odd_count} \leq 1 ), then the string can be permuted into a palindrome. For example, the string "civic" is already a palindrome, and "ivicc" can be rearranged to form "civic". However, "hello" does not meet this criterion and thus cannot form a palindrome.

inputFormat

The input consists of a single line containing the string ( S ). The string is composed of lowercase English letters. It may also be empty.

outputFormat

Output a single line containing either "YES" if the characters of ( S ) can be rearranged to form a palindrome, or "NO" otherwise.## sample

civic
YES

</p>