#C8609. Rearrange to Palindrome

    ID: 52610 Type: Default 1000ms 256MiB

Rearrange to Palindrome

Rearrange to Palindrome

Given a string S, determine if its characters can be rearranged to form a palindrome. In other words, check if there exists an anagram of S that is a palindrome.

A string can be rearranged into a palindrome if and only if the number of characters that appear an odd number of times is at most one. Formally, if we denote by \( f(c) \) the frequency of character \( c \) in S, then a palindromic rearrangement is possible if:

\( \sum_{c}\; [f(c) \bmod 2 \neq 0] \leq 1 \)

inputFormat

The input consists of a single line containing a non-empty string S composed of ASCII characters.

outputFormat

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

## sample
carrace
YES