#K13796. Can Form Palindrome?
Can Form Palindrome?
Can Form Palindrome?
Given a string \(s\) with length \(1 \leq |s| \leq 100000\), 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. In order for a rearrangement of \(s\) to form a palindrome, at most one character is allowed to have an odd frequency; all other characters must appear an even number of times.
For example, the string aabb
can be rearranged into abba
which is a palindrome, whereas abc
cannot be rearranged into any palindrome. Your task is to check if the given string can be rearranged to form a palindrome.
inputFormat
The input consists of a single string \(s\) provided via standard input (stdin). The string contains only standard printable characters and may include spaces.
outputFormat
Output a single line to standard output (stdout) containing YES if the string's characters can be rearranged to form a palindrome, or NO otherwise.
## sampleaabb
YES