Limits 1s, 512 MB

Masha has a good habit of collecting stones. Thus she lives by the side of the sea. Every morning she goes to walk by the side of the sea to collect different kind of beautiful stones. And she contains these stones in a jar. At one random day Masha was sitting under a tree with her random thoughts, looking at the beautiful sea. Now she is thinking, "Does each jar has the same parity or not?". By the way It's just a random thought, so don't judge Masha :p.

Same parity of each jar means,
Each jar have even number of stones or 
Each jar has an odd number of stones.”

Given the number of stones in N\bf{N} jars, you have to help Masha by Telling her if each jar has the same parity or not.

Input

The first line of input contains a single integer N\bf{N}the number of jars Masha has.

The second line contains N\bf{N} integers J1,J2,J3,....,JN\bf{J_1, J_2, J_3,...., J_N}.(Ji\bf{J_i} means the ith\bf{i^{th}} jar contains Ji\bf{J_i} stones)

1N,Ji103\bf{1 \le N, J_i \le 10^3}

Output

Print “Yes”, if each jar has same parity of stones. Otherwise, “No”. (without the quotation marks)

Samples

InputOutput
7
12 32 4 2 23 1 43
No

All numbers are not even and also all numbers are not odd. So they don’t have the same parity.

InputOutput
5
2 4 6 8 10
Yes

All numbers are even. So all of them have the same parity.

InputOutput
6
1 3 5 7 9 11
Yes

All numbers are odd. So all of them have the same parity.


Submit

Login to submit.

Statistics

96% Solution Ratio
Rakib.4411Earliest, Nov '22
Jannatun.180114Fastest, 0.0s
SMshaqibLightest, 4.9 MB
MH.457278Shortest, 150B
Toph uses cookies. By continuing you agree to our Cookie Policy.