#C9288. Palindromic Rearrangement
Palindromic Rearrangement
Palindromic Rearrangement
Given a string s consisting only of lowercase English letters, determine whether its characters can be rearranged to form a palindrome.
A string is a palindrome if it reads the same forwards and backwards. In formal terms, let \( f(c) \) be the frequency of character \( c \) in the string. A rearrangement into a palindrome is possible if and only if:
\( \sum_{c} [f(c) \bmod 2 \neq 0] \leq 1 \)
Output Yes
if such a rearrangement is possible, and No
otherwise.
inputFormat
The input is read from standard input. It consists of a single line containing a non-empty string s
of lowercase English letters.
outputFormat
Print to standard output Yes
if the characters of s
can be rearranged to form a palindrome; otherwise, print No
.
civic
Yes