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:
n = int(input())
li = [int(x)%2 for x in input().split()]
if li.count(1)%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 a:
    if i & 1:
        c += 1
if c & 1 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
# AGC 010 A - Addition
n = int(input())
A = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    N = INT()
    A = LI()
    count = 0
    for i in range(N):
        if A[i]&1:
            count += 1
    if count&1:
        print('NO')
    else:
        print('YES')


if __name__ == '__main__':
    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:
def main():
    n = int(input())
    numbers = list(map(int, input().split()))
    count_odd = 0
    for num in numbers:
        if num % 2:
            count_odd += 1
    print("YES" if count_odd % 2 == 0 else "NO")


if __name__ == '__main__':
    main()

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 == 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 range(N):
    if A[i] % 2 == 1:
        cnt += 1

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
 
ans = 'YES'
if sum(a)%2 != 0:
  ans = 'NO'
  
print(ans)

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
print("YES" if (cnt==0 or cnt%2==0) else "NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = 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:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    for v in a:
        if v % 2 == 1:
            cnt += 1
    if cnt % 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()))
ki = [i for i in a if i%2!=0]
if len(ki)%2 != 0:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
N = int(input())
A = list(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')

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 = map(int,input().split())
n_odd = [odd for odd in A if odd%2==1]
if len(n_odd)%2==1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

odd = 0  # 奇数
even = 0  # 偶数
for ai in A:
    if ai % 2 == 0:
        odd += 1
    else:
        even += 1

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

Submission status: Accepted

Solution code:
from functools import reduce
from operator import xor

n = int(input())
aaa = list(map(int, input().split()))
print('YES' if reduce(xor, aaa) & 1 == 0 else 'NO')

Submission status: Accepted

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

odd = 0
for i in a:
	if i % 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()))
oddcount=0
for i in range(N):
    if A[i]%2==1:
        oddcount=oddcount+1
if oddcount%2==1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

if sum(al) % 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())
al = list(map(int, input().split()))

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

Submission status: Accepted

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

odd_count = 0
even_count = 0

for i in A:
    if i%2==1:
        odd_count += 1
    else:
        even_count += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N  = int(input())
A = [int(i) for i 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:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a_list = list(map(int, input().split()))
    if sum(a_list) % 2 == 1:
        print("NO")
    else:
        print("YES")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a_list = list(map(int, input().split()))
    odds = [a for a in a_list if a % 2 == 1]
    if len(odds) % 2 == 1:
        print("NO")
    else:
        print("YES")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
list_A = [int(x) for x in input().split()]

odd = 0
for A in list_A :
    if A%2 == 1 :
        odd += 1

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = np.array(input().split(), np.int64)

if np.count_nonzero(a % 2 == 1) % 2 == 1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

c = 0

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

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

Submission status: Accepted

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


#----------
N = int(input().strip())
A_list = list(map(int, input().rstrip().split()))
#----------

count=0
for i in A_list:
    if (i % 2) != 0:
        count += 1

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

print(result)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np

def main():
	n=int(input())
	A=list(map(int,input().split()))
	
	ans="YES"
	
	if sum(A)%2:
		ans="NO"
	
	print(ans)
	
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
N=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 = input()
a = list(map(int, input().split()))
# Python: TrueとFalseは0,1と等価
odd_cnt = len([1 for ai in a if ai % 2])
print('YES' if odd_cnt % 2 == 0 else '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:
N = int(input())
A = [int(a) for a in input().split()]
odd = 0
for i, a in enumerate(A):
  odd += a % 2
print("YES" if odd % 2 == 0 else "NO")

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.buffer.readline
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getlist():
    return list(map(int, input().split()))
import math
import bisect
import heapq
from collections import defaultdict, Counter, deque
MOD = 10**9 + 7
INF = 10**15

def main():
    n = getN()
    nums = getlist()
    eo = [0, 0]
    for num in nums:
        eo[num % 2] += 1
    e = (eo[0] + eo[1] // 2) % 2
    o = eo[1] % 2
    if o == 0:
        print("YES")
    else:
        print("NO")
    # print(e,o)

if __name__ == '__main__':
    main()

"""
9999
3

2916
"""

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    print(["YES","NO"][len([1 for i in A if i&1])%2])
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
ev=0
od=0
for i in a:
  if i%2==0:
    ev+=1
  else:
    od+=1
ans=False
if od%2==0:
  ans=True
else:
  if ev==0:
    ans=True
    
print('YES' if ans else 'NO')

Submission status: Accepted

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

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

d, m = divmod(odd, 2)
even += d
odd = m

if odd == 0:
    ans = "YES"
else:
    ans = "YES" if even == 0 else "NO"

print(ans)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    odd = len([a for a in A if a & 1])
    even = N - odd
    if odd & 1:
        print("NO")
    else:
        print("YES")


if __name__ == '__main__':
    main()

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 range(N):
    if A[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())
L=list(map(int,input().split()))
count=0
for i in range (N):
	if L[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()))
c = 0
for e in A:
    if e%2 == 1:
        c += 1
if c%2 == 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
if __name__ == "__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 == 1:
        print('NO')
    else:
        print('YES')

Submission status: Accepted

Solution code:
N  = int(input())
A = [int(i) for i 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,*a=map(int,open(0).read().split());print("YNEOS"[sum(map(lambda x:x%2, a))%2::2])

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!=0:
        cnt+=1
print('YES' if cnt%2==0 else 'NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

o,e = 0,0
for i in a:
    if i % 2 == 0:
        e += 1
    else:
        o += 1

if o % 2 == 1:
    print('NO')
    exit()

print('YES')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int,input().split()))
    n_odd = len([A[i] for i in range(N) if A[i]%2 != 0])
    n_even = N - n_odd
    if n_odd%2 != 0:
        print("NO")
    else:
        print("YES")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
li_a = list(map(int, input().split()))
c_kisuu = len([a for a in li_a if a % 2 != 0])

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
count=0
for i in range(n):
  if l[i]%2==1:
    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()))

ar = []
for val in a:
    ar.append(val % 2)

if sum(ar) % 2:
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

print('NO' if (sum(map(lambda x:x%2, nums)))%2 else 'YES')

Submission status: Accepted

Solution code:
N = int(input())
A_lst = [int(n) for n in input().split()]
odd = 0
even = 0
for A in A_lst:
    if A%2 == 0:
        even += 1
    else:
        odd += 1
print('YES') if odd%2 == 0 else print('NO')

Submission status: Accepted

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

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

odd_rest = odd % 2
even += odd // 2
even_rest = even % 2

if (odd_rest + even_rest) == 2:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = [int(_) for _ in 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:
import sys
n = int(input())
a_ls = [int(i) for i in sys.stdin.readline().split()]
if sum([i % 2 for i in a_ls]) % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr=limii()

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

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

Submission status: Accepted

Solution code:
input()
if len(["" for i in input().split() if int(i)%2 == 1])%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(0,N):
    if A[i]%2==1:
        odd=odd+1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def roundUp(a, b):
        return -(-a // b)

    @staticmethod
    def toUpperMultiple(a, x):
        return Math.roundUp(a, x) * x

    @staticmethod
    def toLowerMultiple(a, x):
        return (a // x) * x

    @staticmethod
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

    @staticmethod
    def sign(n):
        if n == 0:
            return 0
        if n < 0:
            return -1
        return 1

    @staticmethod
    def isPrime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.__q = l
        heapq.heapify(self.__q)
        return

    def push(self, n):
        heapq.heappush(self.__q, n)
        return

    def pop(self):
        return heapq.heappop(self.__q)


MOD = int(1e09) + 7
INF = int(1e15)


def main():
    # sys.stdin = open("sample.txt")
    N = Scanner.int()
    A = Scanner.map_int()
    odd = sum([x % 2 == 1 for x in A])
    print("YNEOS "[odd % 2::2])
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
result = 0
for i in range(N):
  if A[i] % 2 == 1:
    result += 1
    
print("YES" if result % 2 == 0 else "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()))
Odds = list(filter(lambda x:x%2 == 1,A))
Odds_num = len(Odds)
if Odds_num % 2 == 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

# 奇数 + 奇数 = 偶数
# 偶数 + 偶数 = 偶数

# 偶数列は最終的に一つになるまで操作可能
# 奇数1余るか余らないかで決まる

evens = list(filter(lambda x: x % 2 == 1, numbers))
evens_mod = len(evens) % 2

if evens_mod == 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

odds = list(filter(lambda x: x % 2 == 0, numbers))
evens = list(filter(lambda x: x % 2 == 1, numbers))

# evens_from_odds = sum(divmod(len(odds), 2))
# odds_from_evens = sum(divmod(len(evens), 2))
odds_from_evens = int(len(evens) / 2)
evens_mod = len(evens) % 2
if evens_mod == 1:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
e=0
o=0
for i in range(n):
    if a[i]%2==0:
        e+=1
    else:
        o+=1
if n%2==0 and o%2==0:
    print("YES")
elif n%2!=0 and o%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

ans=["YES","NO"]

print(ans[count%2])

Submission status: Accepted

Solution code:
input()
a = list(map(int, input().split()))
l = len(list(filter(lambda x : x & 1, a)))
if l & 1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
n = int(input())

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

even = 0
odd = 0

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

if even == 0 or odd == 0:
    print("YES")
elif (odd%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:
    print("YES")
else :
    print("NO")

Submission status: Accepted

Solution code:
# B 
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n=ni()
a=nl()
a=[x%2 for x in a]
if sum(a)%2==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

if cnt%2!=0:
    print('NO')

else:
    print('YES')

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int, input().split()))
od = [x for x in li if x%2==1]

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

Submission status: Accepted

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

add_or_not = [True if i%2==1 else False for i in a_list]
if sum(add_or_not) %2 == 1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
count = 0
for i in li:
    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()))

c=0
for n in A:
    if(n%2==1):
        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()))
if sum(A)%2==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

ans = 'NO'

even = []
odd = []

for i in li:
  if i % 2 == 0:
    even.append(i)
  else:
    odd.append(i)

if len(odd) % 2 == 0:
  ans = 'YES'
  
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
tp = tuple(map(int, input().split()))

even = 0
odd = 0

for i in range(n):
    if tp[i] % 2 == 0:
        even += 1
    elif tp[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(int, input().split()))
o = [a for a in A if a % 2 != 0]


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

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
e = []
o = []
e_append = e.append
o_append = o.append

for a in A:
    if a % 2 == 0:
        e_append(a)
    else:
        o_append(a)

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

Submission status: Accepted

Solution code:
def examA():
    N = I()
    A = LI()
    ans = "YES"
    cur = 0
    for a in A:
        if a%2==1:
            cur +=1
    if cur%2==1:
        ans = "NO"
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,inf
mod = 10**9 + 7
inf = 10**18

if __name__ == '__main__':
    examA()

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:
	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(int,input().split()))
odd=0
even=0
for i in range(n):
  if a[i]%2==1:
    odd+=1
  else:
    even+=1
if odd%2==1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
N = int(input())
a = list(map(int, input().split()))
kcnt = 0
for i in range(N):
    if a[i] % 2 != 0:
        kcnt += 1

if kcnt % 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 != 0:
    cnt += 1
print("YES" if cnt % 2 == 0 else "NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n = II()
    a = LI()
    print("NO" if sum(map(lambda x: x & 1, a)) & 1 else "YES")
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

Submission status: Accepted

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