#K14276. Flexible Palindrome Formation

    ID: 24099 Type: Default 1000ms 256MiB

Flexible Palindrome Formation

Flexible Palindrome Formation

You are given an integer N. Your task is to determine whether its digits can be rearranged to form a palindrome.

A palindrome is a sequence that reads the same backwards and forwards. A rearrangement into a palindrome is possible if and only if at most one digit appears an odd number of times. In other words, if more than one digit has an odd frequency, it is impossible to form a palindrome.

For example, if N = 12321, you can rearrange the digits to form "12321" or "21312", which are palindromic. However, if N = 123, no permutation of its digits forms a palindrome.

Print YES if the digits of N can be rearranged to form a palindrome, otherwise print NO.

inputFormat

Input is read from standard input (stdin). It consists of a single line containing an integer N (without any additional spaces or characters).

outputFormat

Output should be written to standard output (stdout) and consist of a single line: either YES if the digits of N can be rearranged to form a palindrome, or NO if they cannot.## sample

12321
YES