#K90682. Rearrange String into a Palindrome

    ID: 37807 Type: Default 1000ms 256MiB

Rearrange String into a Palindrome

Rearrange String into a Palindrome

You are given a string s consisting only of lowercase English letters. Your task is to determine whether it is possible to rearrange the characters of s to form a palindrome.

A palindrome is a string that reads the same forwards and backwards. In order for the permutation of s to be a palindrome, at most one character can appear an odd number of times. In mathematical terms, if \(c_i\) is the count of the \(i\)-th character, then the string can be rearranged into a palindrome if and only if:

\(\sum_{i}[c_i \mod 2 \neq 0] \le 1\)

For example, the string "aabb" can be rearranged into "abba" while the string "abc" cannot form any palindrome.

inputFormat

The input consists of a single line containing a string s (possibly empty) which contains only lowercase English letters.

outputFormat

Output a single line containing YES if the characters of s can be rearranged to form a palindrome; otherwise, output NO.

## sample
aabb
YES