Problem:


Score : 300 points

Problem Statement

There are N integers written on a blackboard. The i-th integer is A_i.

Takahashi will repeatedly perform the following operation on these numbers:

Select a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.

Then, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.

Determine whether it is possible to have only one integer on the blackboard.

Constraints

2 ≦ N ≦ 10^5

1 ≦ A_i ≦ 10^9

A_i is an integer.

Input

The input is given from Standard Input in the following format:

N
A_1 A_2 … A_N

Output

If it is possible to have only one integer on the blackboard, print YES. Otherwise, print NO.

Sample Input 1

3
1 2 3

Sample Output 1

YES

It is possible to have only one integer on the blackboard, as follows:

Erase 1 and 3 from the blackboard, then write 4. Now, there are two integers on the blackboard: 2 and 4.

Erase 2 and 4 from the blackboard, then write 6. Now, there is only one integer on the blackboard: 6.

Sample Input 2

5
1 2 3 4 5

Sample Output 2

NO



Sample input:
3
1 2 3


Sample output:
YES

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
even=0
odd=0
for i in A:
    if i%2==0:
        even+=1
    else:
        odd+=1

if odd%2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N=int(input())

A=list(map(int,input().split()))

ki=len([i for i in A if i % 2 == 1])

if ki%2==1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
    if a[i]%2!=0:
        c+=1
if c%2==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

"""
・ev,ev -> ev or od,od -> ev
・奇数の個数 mod 2 が不変量
・1回以上操作をすると偶数が1つ以上残る
・N >= 2なので偶数が残る。よってodが奇数個ならむり
・奇数が偶数個なら、奇数を固めたあとつぶしていけばできる
"""

N,*A = map(int,read().split())

od = sum(x&1 for x in A)
answer = 'NO' if od & 1 else 'YES'
print(answer)

Submission status: Accepted

Solution code:
n=int(input())
a=map(int,input().split())
e,o=0,0
for i in a:
    if i%2==1:
        o+=1
if o%2==0 or n==1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = input()
A = map(int, raw_input().split())
if sum(num % 2 for num in A) % 2 == 0:
  print "YES"
else:
  print "NO"

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
jdg=0
for i in range(n):
  if a[i]%2:
    jdg+=1
if jdg%2:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
N = int(input())
nums = list(map(int, input().split()))

evens = [nums[i] for i in range(N) if nums[i] % 2 == 0]
odds  = [nums[i] for i in range(N) if nums[i] % 2 != 0]

if len(odds) % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A  = list(map(int, input().split(' ')))

n = len([a for a in A if a % 2 == 1])
if n % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

if sum(a) % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

count = 0
for i in a:
    if i % 2 != 0:
        count += 1

if count % 2 != 0:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]

o = 0
for a in A :
  if a % 2 == 1 :
    o += 1
    
if o % 2 != 0 :
  print('NO')
else :
  print('YES')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
wa=sum(a)
if wa%2==0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:


def main()->None:
    N = int(input())
    A = map(int, input().split())

    odd_count = 0
    for a in A:
        if a % 2 == 1:
            odd_count += 1

    if odd_count % 2 == 0:
        print("YES")
    else:
        print("NO")



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
    if i%2!=0:
        count+=1

print('YES' if count%2==0 else 'NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt = 0 
for i in A:
        if i % 2 != 0:
                cnt += 1 

if cnt % 2 == 0:
        print("YES")
else:
        print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
if S % 2 == 0:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

odd_cnt = 0
for i in range(n):
    if a[i]%2 == 1:
        odd_cnt += 1
if odd_cnt % 2 == 0 or (odd_cnt == 1 and a.index(1)>0):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())
a = list(map(int, input().split()))

#全部の和が奇数の時点でアウト
if sum(a) % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
sm = 0
for i in range(N):
    sm += A[i]%2
if sm%2:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
eve, odd = 0, 0
for a in A:
  if a%2==1:
    odd += 1
print('YES' if odd%2==0 else 'NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

temp = 0

for x in a:
    if x % 2 == 1:
        temp += 1
        
if temp % 2 == 1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))

k = []

for i in range(n):
	k.append(l[i]%2)
	
print('YES' if sum(k)%2==0 else 'NO')

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int,input().split()))
cnt = 0
for i in range(n):
  if L[i]%2 == 1:
    cnt += 1
if cnt%2 == 1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
ans='YES'
c=0
for i in range(n):
    if l[i]%2:
        c+=1
if c%2:
    ans='NO'
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in a:
  if i%2>0:
    ans+=1
if ans%2:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    cnt = 0
    for v in a:
        if v % 2 != 0:
            cnt += 1
    print("YES" if cnt % 2 == 0 else "NO")


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = int(input())
cn = 0
a = list(map(int,input().split()))

for _ in range(n):
    
    if(a[_]%2==1):
        cn += 1
    
if(cn%2==1):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in a:
    if i%2==1:
        cnt+=1
print('YES' if cnt%2==0 else 'NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
odd = 0
for i in range(N):
    if A[i]%2 == 1:
        odd += 1
if odd%2 ==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
c = 0
for i in A:
  if i%2:
    c += 1
if c%2==0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
Alist = np.array(list(map(int, input().split())))
odd = np.count_nonzero(Alist % 2)
if odd % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
input()
print("YES") if sum(map(int, input().split())) % 2 == 0 else print("NO")

Submission status: Accepted

Solution code:
_ = input()
As = [int(x) for x in input().split()]
if sum(As)%2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
a = inpl()
cnt = 0
for i in a:
    if i%2:
        cnt += 1
if cnt%2:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
odd=0
for i in range(n):
  odd+=(a[i]%2==1)
print(("NO","YES")[odd%2==0])

Submission status: Accepted

Solution code:
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353


N = int(sys.stdin.buffer.readline())
A = list(map(int, sys.stdin.buffer.readline().split()))

c = 0
for a in A:
    c += a & 1
if c % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())

if sum(map(int, input().split()))%2:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]

odd_list = [i for i in a if i%2]
odd_count = len(odd_list)

if (odd_count == 0 or odd_count %2 == 0):
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
c=0
for i in range(n):
    if a[i]%2!=0:
        c+=1
if c%2==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

count = 0
for i in range(n):
    if a[i] % 2 == 1:
        count += 1

if count % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

N = int(input().split()[0])
a_list = list(map(int, input().split()))

odd_n = 0
even_n = 0

for a in a_list:
    if a % 2 == 1:
        odd_n += 1
    else:
        even_n += 1

ans = "YES" if odd_n % 2 == 0 else "NO"

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int,input().split()))

cnt_odd = 0
cnt_even = 0

for x in li:
    if x%2 == 0:
        cnt_even += 1
    else:
        cnt_odd += 1
        
if cnt_odd%2 != 0:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
# AGC010
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
    if a % 2 == 1:
        cnt += 1
if cnt % 2 == 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
*a, = map(int, input().split())
print("NO" if len(list(filter(lambda x: x%2, a)))%2 else "YES")

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))

if N==1:
    print("YES")
    exit()

odd=0
even=0
for item in A:
    if item%2==1:
        odd+=1
    else:
        even+=1

if odd%2==1:
    print("NO")
    exit()
else:
    even+=odd//2
        
print("YES")

Submission status: Accepted

Solution code:
input()
print('YES' if sum(map(int,input().split()))%2==0 else 'NO')

Submission status: Accepted

Solution code:
n=int(input())
al=list(map(int,input().split()))
c=0
for a in al:
    c+=1 if a%2==1 else 0
print('YES' if c%2==0 else 'NO')

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))

    cnt = 0
    for e in a:
        if e % 2:
            cnt += 1

    print("YES" if cnt % 2 == 0 else "NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
odd=0;even=0
for i in range(n):
    if a[i]%2==1:
        odd+=1
    else:
        even+=1
#print(odd,even)
if odd%2==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
input()
list_ = [n % 2 for n in map(int, input().rstrip("\n").split())]

print("NO" if list_.count(1) % 2 else "YES")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

count = 0
for i in a:
    if i % 2 == 1:
        count += 1
if count % 2 == 1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
X=0
for i in range(N):
  if(A[i]%2):
    X+=1
if(X%2):
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

n = sys.stdin.readline().rstrip()
nums = (int(i) for i in sys.stdin.readline().rstrip().split())

if sum(nums) % 2 == 0:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys

n = sys.stdin.readline().rstrip()
nums = (int(i) for i in sys.stdin.readline().rstrip().split())

odds = 0
for a in nums:
  if a % 2 != 0:
    odds += a

if odds % 2 == 0:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
odd = 0
for i in range(N):
    if A[i] % 2 == 1:
        odd += 1
if odd % 2 == 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(lambda x: int(x), input().split()))
cnt=0
for i in a:
    if i%2==1:
        cnt+=1
if cnt%2==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n=int(input())
items=list(map(int,input().split()))
cnt=0
for i in items:
  if i%2:
    cnt+=1
if cnt%2==0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    numbers = list(map(int, input().split()))

    temp_numbers = [n % 2 for n in numbers]
    number_of_even = temp_numbers.count(0)
    number_of_odd = temp_numbers.count(1)
    while number_of_odd >= 2:
        temp = number_of_odd // 2
        number_of_even += temp
        number_of_odd -= temp * 2

    while number_of_even >= 2:
        temp = number_of_even // 2
        number_of_even -= temp

    if number_of_even + number_of_odd >= 2:
        print('NO')
    else:
        print('YES')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np

n = input()
A = np.array(list(map(int, input().split())))

A = np.where(A % 2 == 0, 0, 1)
if sum(A) % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
import bisect
import collections
import fractions
import heapq


def slove():
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    for i in range(n):
        if a[i] % 2 != 0:
            cnt += 1
    if cnt % 2 == 0:
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
c=0
for i in range(n):
    if l[i]%2==1:
        c+=1
e=n-c
if c%2==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = map(int,input().split())

if sum(A) % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = map(int,input().split())
O = 0
E = 0

for i in A:
    if i % 2 == 1:
        O += 1
    else:
        E += 1
if O % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int,input().split()))

ans = 0
for i in A:
    ans ^= i
if ans % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N=int(input())
lis=list(map(int,input().split()))
sum =0
for i in range(N):
  sum += lis[i]%2
if sum%2==1:
  print("NO")
if sum%2==0:
  print("YES")

Submission status: Accepted

Solution code:

N = input()

A = list(map(int,input().split()))


num = 0

for i in A:

    if i % 2 == 1:
        num += 1

if num % 2 == 0:
    print ("YES")
else:
    print ("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [i for i in A if i % 2 == 1]

if len(A) % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
m = 0
a = input().split()

for i in range(n):
    m += int(a[i])
    
if m % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
n=int(input())
a = list(map(int,input().split()))	
odd=0
for i in range(n):
    if a[i]%2==1:
        odd+=1
if odd %2==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=[x for x in A if x%2==1]
print('YES' if len(B)%2==0 else 'NO')

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
odd = 0
for i in a:
    if i % 2:
        odd += 1
if odd % 2:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))

odd = 0
for i in a:
    if i % 2 == 1:
        odd += 1
if odd % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
even = []
odd = []

for i in range(len(A)):
    if A[i] % 2 == 0:
        even.append(A[i])

    else:
        odd.append(A[i])

if len(odd) % 2 == 1:
    print("NO")

else:
    print("YES")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))

lO = [ i for i in A if i % 2 == 1 ]

if len(lO) % 2 == 0:
  print("YES")
  
else:
  print("NO")

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
oddCnt = 0
for i in A:
  if i % 2 == 1:
    oddCnt += 1
if oddCnt % 2 == 1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    a = list(map(int,input().split()))
    num = 0
    for i in a:
        if i%2 == 1:
            num += 1
    print("YES") if num%2 == 0 else print("NO")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
for a in A:
    if a % 2 != 0:
        count += 1
if count % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))

cnt=0
for i in range(N):
    if A[i]%2==1:
        cnt+=1

if cnt%2==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int,input().split()))

even = 0
odd = 0
for i in a:
  if i%2 == 0:
    even += 1
  else:
    odd += 1

if odd%2 == 0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N=int(input())
print("NO" if sum(map(lambda x: int(x)%2,input().split()))%2 else "YES")

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int, input().split()))

if sum(arr) % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
if (sum(A))%2 == 0 :
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
def solve(n, a):
    odd = 0
    even = 0
    for x in a:
        if x % 2 == 0:
            even += 1
        else:
            odd += 1
    res = int(odd % 2) + int((even + (odd // 2)) > 0)
    return "YES" if (res == 1) else "NO"

n = int(input())
a = list(map(int, input().split()))
print(solve(n, a))

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/agc010/tasks/agc010_a

n = int(input())
def process(x):
    x = int(x)
    if x%2 == 0:
        return 0
    else:
        return 1
data = list(map(process, input().split()))
l = [x for x in data if x == 1]
if len(l)%2==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
As = list(map(int, input().split()))

if sum(As)%2==0:
  ans = 'YES'
  
else:
  ans = 'NO'
  
print(ans)

Submission status: Accepted

Solution code:
# AGC010A - Addition
def main():
    # all evens and pairs of odds become a single number
    # -> check an odd (not pair) remains or not <-> parity of A
    N, *A = map(int, open(0).read().split())
    flg = sum(A) % 2 == 0
    print("YES" if flg else "NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import numpy as np
input = sys.stdin.readline

def main():
    N = int(input())
    a = np.array(list(map(int, input().split())))

    if sum(a % 2)&1:
        print("NO")
    else:
        print("YES")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
A_odd = list(filter(lambda n:n%2==1, A))
if len(A_odd) % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
a = input().split()
a = [int(i) for i in a]

odds = len([i for i in a if i % 2 == 1])
evens = len([i for i in a if i % 2 == 0])

if odds % 2 == 1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int,input().split()))
if sum(s) % 2 == 0:
         print("YES")
else:
         print("NO")

Submission status: Accepted

Solution code:
N = int(input())
As = list(map(int, input().split()))
nO = len([a for a in As if a%2 == 1])
if nO%2 == 0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        A = map(int, input().split())

        odd_cnt = 0
        for a in A:
            if a % 2 == 1:
                odd_cnt += 1
        print('YES' if odd_cnt % 2 == 0 else 'NO')


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int, input().split()))
odd = 0
for i in range(n):
    if arr[i] % 2 != 0:
        odd += 1
print('YES' if odd % 2 == 0 else 'NO')

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int, input().split()))

odd = 0
for i in range(n):
    if arr[i] % 2 != 0:
        odd += 1

if odd % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N,*A=map(int,open(0).read().split());print("YNEOS"[sum(a%2for a in A)%2::2])

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
if sum(1 for i in a if i % 2 == 1) % 2 == 1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
N = int(input())
odd = len(list(filter(lambda x: int(x) % 2, input().split())))
even = N - odd

even += odd // 2
even %= 2
odd %= 2

print('NO' if odd == even == 1 else 'YES')

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = int(input())
    A = list(map(int, input().split()))
    
    odd_is_even = True
    for Ai in A:
        if Ai % 2 == 1:
            odd_is_even = not odd_is_even
    
    if odd_is_even:
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
gu=0
ki=0
for i in a:
    if i%2:
        ki+=1
    else:
        gu+=1
if ki%2:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
print('YNEOS'[sum([i % 2 for i in map(int,input().split())])%2::2])

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    for v in a:
        if v % 2 != 0:
            cnt += 1
    print("YES" if cnt % 2 == 0 else "NO")


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res

def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n = I()
    a = LI()
    s = 0
    for i in a:
        s ^= (i%2)
    if s:
        print("NO")
    else:
        print("YES")
    return

#B
def B():
    n = I()

    return

#C
def C():
    n = I()

    return

#D
def D():
    n = I()

    return

#E
def E():
    n = I()

    return

#F
def F():
    n = I()

    return

#Solve
if __name__ == "__main__":
    A()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
odd = 0
even = 0

for a in A:
    if a % 2 != 0:
        odd += 1
    else:
        even += 1

if odd % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
n = int(input())
A = [int(el) for el in input().split(' ')]

odd = 0
for a in A:
    if a % 2 == 1:
        odd += 1
if odd % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
count = 0
for i in range(N):
    if A[i]%2==1:
        count += 1
if count%2==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0
    for i in range(N):
        if A[i] % 2 == 1: count +=1
    if count % 2 == 0:
        return "YES"
    return "NO"

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
if sum(A) % 2 == 0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = input()
A = list(map(int, input().split()))
s = sum(A)
if s%2==0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#AGC10 A

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = LI()
cnt = 0
for i in range(n):
    if a[i] % 2:
        cnt += 1
if cnt % 2:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
#AGC010A
import sys
import collections

n= int(input())
tmp = input().split()
a = list(map(lambda a: int(a), tmp))

count=0
for i in range(0,n):
	if(a[i]%2==1):
		count+=1
if(count%2==0):
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
N = int(input())
arr = list(map(int, input().split()))

cnt = 0
for x in arr:
    if x % 2 != 0:
        cnt += 1

print('YES' if cnt % 2 == 0 else 'NO')

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    even = 0
    odd = 0
    for aa in a:
        if aa%2 == 0:
            even += 1
        else:
            odd += 1
    if odd % 2 == 1:
        print('NO')
        return
    print('YES')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
o=0
e=0
for i in range(n):
	if a[i]%2==0:
		e+=1
	else:
		o+=1
if o%2==0:
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
print("YES" if sum(A)%2==0 else "NO")

Submission status: Accepted

Solution code:
nums = int(input())
ary = list(map(int, input().split()))
parity = [0,0]

# 奇数、偶数の数をとる
for i in ary:
    if   i % 2 == 0:
        parity[0] += 1
    elif i % 2 == 1:
        parity[1] += 1

while not parity[0] + parity[1] <= 2:
    if parity[0] >= 2:
        parity[0] -= 2
        parity[0] += 1
    elif parity [1] >= 2:
        parity[1] -= 2
        parity[0] += 1
if parity[0] == 2 or parity[1] == 2:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
N = int(input())
para = [int(i) for i in input().split()]
odd = 0
even = 0
for i in range(N):
    if para[i] % 2 == 0 :
        even += 1
    else : odd += 1

even += (odd//2)
odd = (odd % 2)
while even > 1:
    p = (even//2)
    q = (even % 2)
    even = (p + q)

if (odd + even) == 1 :
    print("YES")
else :
    print("NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections, copy, heapq

YES = "YES"  # type: str
NO = "NO"  # type: str

def solve(N: int, A: "List[int]"):
    O = len([aa for aa in A if aa % 2 == 1])
    E = len([aa for aa in A if aa % 2 == 0])
    o = True if O % 2 == 1 else False
    E += O // 2
    while E > 1:
        E = E // 2 + E % 2
    e = True if E == 1 else False

    if o ^ e:
        print("YES")
    else:
        print("NO")
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import heapq
from operator import itemgetter
from collections import deque, defaultdict
from bisect import bisect_left, bisect_right
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def sol():
    N = int(input())
    A = [int(x) for x in input().split()]

    oddCount = 0
    for a in A:
        if a % 2 == 1:
            oddCount += 1

    if oddCount % 2 == 0:
        print('YES')
    else:
        print('NO')


sol()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))

gk=0
for i in range(n):
  gk=gk+a[i]%2

if(gk%2==0):
  print("YES")
  exit()
else:
  print("NO")
  exit()

Submission status: Accepted

Solution code:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
A = list(map(int, input().split()))
print('YES') if sum(A) % 2 == 0 else print('NO')

Submission status: Accepted

Solution code:
n=int(input())
l=[int(i)%2 for i in input().split()]
if l.count(1)%2==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    return "YES" if sum(a) % 2 == 0 else "NO"


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x)%2 for x in input().split()]
odd = A.count(1)
print('YNEOS'[odd%2==1::2])