#K6761. Palindrome Rearrangement

    ID: 32681 Type: Default 1000ms 256MiB

Palindrome Rearrangement

Palindrome Rearrangement

Given a string s, determine whether its characters can be rearranged to form a palindrome. A palindrome reads the same forwards and backwards.

A string can be rearranged into a palindrome if and only if the number of characters that appear an odd number of times in s is at most one. Mathematically, let \( oddCount \) be the number of characters with an odd frequency, then the condition is:

\( oddCount \leq 1 \)

For example:

  • If s = "civic", then the answer is Yes.
  • If s = "ivicc", then the answer is Yes.
  • If s = "hello", then the answer is No.

inputFormat

The input consists of a single line containing the string s. The string may contain lowercase English letters and can be empty.

outputFormat

Output a single line: Yes if the string can be rearranged into a palindrome, otherwise No.

## sample
civic
Yes