#arc161a. [arc161_a]Make M
[arc161_a]Make M
Problem Statement
Let be a positive odd number. A sequence of integers of length , , is said to be M-type if "for each even number , it holds that and ".
You are given a sequence of positive integers of length , . Determine if it is possible to rearrange to be M-type.
Constraints
- is an odd number.
Input
The input is given from Standard Input in the following format:
Output
If it is possible to rearrange the given integer sequence to be M-type, print Yes
; otherwise, print No
.
Sample Input 1
5
1 2 3 4 5
Sample Output 1
Yes
The given sequence is . After rearranging it, for example, to ,
- for , it holds that and ;
- for , it holds that and .
Therefore, this sequence is M-type, and the answer is Yes
.
Sample Input 2
5
1 6 1 6 1
Sample Output 2
Yes
The given sequence itself is M-type.
Sample Input 3
5
1 6 6 6 1
Sample Output 3
No
It is impossible to rearrange it to be M-type.