#C4348. Interesting Palindromic String

    ID: 47876 Type: Default 1000ms 256MiB

Interesting Palindromic String

Interesting Palindromic String

In this problem, you are given a string S. Your task is to determine if the characters of S can be rearranged to form a palindrome. A palindrome is a string that reads the same backward as forward.

Mathematically, for a string S with character frequencies ( f(c) ), it can form a palindrome if and only if at most one character has an odd frequency, i.e., ( \sum_{c \in S} [f(c) \bmod 2 \neq 0] \leq 1 ).

An empty string is considered a valid palindrome. Output "YES" if it is possible, otherwise output "NO".

inputFormat

The input consists of a single line containing the string S. The string contains only lowercase English letters. It is read from STDIN.

outputFormat

Output a single line: "YES" if the characters of S can be rearranged to form a palindrome, otherwise output "NO". The answer is written to STDOUT.## sample

civic
YES