#C1237. Rearrange to Palindrome
Rearrange to Palindrome
Rearrange to Palindrome
Given a string s
consisting of lowercase English letters, determine if its characters can be rearranged to form a palindrome.
A palindrome is a string that reads the same forwards and backwards. According to the well-known property, a string can be rearranged into a palindrome if at most one character appears an odd number of times. In mathematical terms, if we define \(O\) as the number of characters with an odd frequency, then the string can be rearranged to form a palindrome if and only if \(O \leq 1\).
For example, the string "civic" is already a palindrome, while "ivicc" can be rearranged to "civic", which is also a palindrome. However, the string "hello" cannot be rearranged into a palindrome.
inputFormat
The input consists of a single line containing a string s
with only lowercase English letters. The input is provided via standard input (stdin).
outputFormat
Output a single line: "YES" if it is possible to rearrange the characters of the string to form a palindrome, and "NO" otherwise. The output should be printed to standard output (stdout).
## samplecivic
YES