#C7445. Rearrange to Palindrome

    ID: 51317 Type: Default 1000ms 256MiB

Rearrange to Palindrome

Rearrange to Palindrome

You are given a series of words. For each word, determine whether its characters can be rearranged to form a palindrome. A string can be rearranged to form a palindrome if and only if at most one character appears an odd number of times. Formally, let \(n_c\) be the occurrence of character c in the string. The string can form a palindrome if:

\(\sum_{c}(n_c \bmod 2) \leq 1\)

The input ends with a special word "END", which should not be processed. For each processed word, output "YES" if it satisfies the condition, otherwise output "NO".

inputFormat

Input is read from STDIN. Each test case consists of multiple lines, each containing one word. The sequence of words is terminated by a line containing only the word "END".

outputFormat

For each word (except "END"), print a single line to STDOUT. Print "YES" if the characters of the word can be rearranged to form a palindrome, otherwise print "NO".

## sample
civic
ivicc
hello
END
YES

YES NO

</p>