#C9857. Can Form Palindrome
Can Form Palindrome
Can Form Palindrome
Given a string s consisting of lowercase letters and digits, determine whether the characters of s can be rearranged to form a palindrome. A palindrome is a word or phrase that reads the same backward as forward. In other words, at most one character in the string can have an odd frequency.
Formally, let \( f(c) \) denote the frequency of character \( c \) in the string. A palindrome can be formed if and only if \( \sum_{c} \llbracket f(c) \mod 2 \neq 0 \rrbracket \leq 1 \), where \( \llbracket \cdot \rrbracket \) is the Iverson bracket.
inputFormat
The input consists of a single line containing the string s \( (1 \leq |s| \leq 10^5) \), composed of lowercase letters and digits.
outputFormat
Output a single line containing YES if the characters of s can be rearranged to form a palindrome, or NO otherwise.
## samplecivic
YES