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())
a = list(map(int, input().split()))
b = []
for num in a:
  b.append(num%2)
  
import collections
c = collections.Counter(b)

num0=c[0]
num1=c[1]
num0 += num1//2
num0 %= 2
num1 = num1%2

if num0+num1==2:
  print("NO")
else:
  print("YES")

Submission status: Accepted

Solution code:
import math
import queue
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=qb
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def dq():
	return queue.deque()
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1

n = readInt()
neven = 0
nodd = 0
for i in readInts():
	if i%2==0:
		neven+=1
	else:
		nodd+=1

if nodd%2==1:
	if neven==0:
		print("YES")
		exit()
	else:
		print("NO")
		exit()
else:
	print("YES")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    l=list(map(int,input().split()))
    if sum(l)%2==1:
        print('NO')
    else:
        print('YES')
resolve()

Submission status: Accepted

Solution code:
# A - Addition

N = int(input())
A = list(map(int, input().split()))
k = 0
for i in range(N):
    k = (A[i] + k) % 2
k *= int(N!=1)
ans = ['YES', 'NO']
print(ans[k])

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    L=list(map(int,input().split()))
    print('YES' if sum(L)%2==0 else 'NO')
    
resolve()

Submission status: Accepted

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

# A - Addition
n = int(input())
a = list(map(int, input().split()))
odd_count = 0
even_count = 0

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect


def main():
    n = int(input())
    A = list(map(int, input().split()))
    cnt = 0
    for a in A:
        if a % 2:
            cnt += 1
    if cnt % 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()))
even = 0
not_even = 0
for v in a:
  if v%2==0: even += 1
  else: not_even += 1
  if not_even == 2:
    even += 1
    not_even = 0
print("YES" if not_even == 0 else "NO")

Submission status: Accepted

Solution code:
_=input()
*a,=map(int, input().split())
if sum(a)%2:
    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:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
N=input()
o = len([i for i in input().split() if int(i)%2!=0])
print("YES" if o%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==1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    A_arr = list(map(int,_in[1].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    A_arr_odd = [A for A in A_arr if A%2==1]
    TF = 'YES' if len(A_arr_odd)%2==0 else 'NO'
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(TF)

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 == 0:
    print('YES')
else :
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t=0
A=list(map(int, input().split()))
for i in range(n):
  t+=A[i]
if t%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 = list(map(int, input().split()))
odd = [x%2!=0 for x in A].count(True)
if odd%2 == 0:
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

a=0
b=0
for i in range(N):
    val=A[i]
    if val%2==0:
        a+=1
    else:
        b+=1

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

Submission status: Accepted

Solution code:
n=input();print("YNEOS"[sum(int(x)%2 for x in input().split())%2::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt_even = 0
cnt_odd = 0

for v in A:
	if v % 2 == 0:
		cnt_even += 1
	else:
		cnt_odd += 1

add_even = cnt_odd // 2 # odd + odd = even
cnt_odd -= add_even * 2

print('YES') if cnt_odd == 0 else print('NO')

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    print('NO' if sum(map(int,input().split()))%2 else 'YES')
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

odd = 0

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

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

Submission status: Accepted

Solution code:
input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    print('YES' if sum(list(map(lambda x: int(x)%2, input().split())))%2 == 0 else 'NO')

if __name__ == '__main__':
  main()

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math

N = int(input())
A = list(map(int, stdin.readline().rstrip().split()))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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==1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
def resolve():
    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==0:
        print('YES')
    else:
        print('NO')
resolve()

Submission status: Accepted

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

count = 0

for i in range(len(A)):
    if A[i]%2!=0:
        count = 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()))
odd=[]
even=[]
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:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    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')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
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())
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 = [int(i) for i in input().split()]

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

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

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

Submission status: Accepted

Solution code:
def main():
  ans = 'YES'
  n = int(input())
  l = list(map(int, input().split()))
  if sum(l)%2 != 0:
      ans = 'NO'
  print(ans)

if __name__ == '__main__':
  main()

Submission status: Accepted

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

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 != 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()))
if sum(A) % 2 == 0:
    print("YES") 
else:
    print("NO")

Submission status: Accepted

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

gokei = sum(Ai)
if gokei % 2 == 1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
_, *a = map(int, open(0).read().split())
odd = sum(ai % 2 for ai in a)
print('YNEOS'[odd % 2::2])

Submission status: Accepted

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

lis = []
for name in li:
    if name % 2 == 1:
        lis.append(name)
        
if len(lis)%2==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

B=[0]*N
i=0
while i<N:
    B[i]=A[i]%2
    i+=1

if B.count(1)%2==1 and 2<=N:
    print('NO')

else:
    print('YES')

Submission status: Accepted

Solution code:
N=int(input())
cnt=len(list(filter(lambda a:a%2==1, map(int,input().split()))))

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())
a=list(map(int,input().split()))
m=0
for i in a:
  if i%2==1:
    m+=1
if m%2==0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    _=input()
    A=[int(a) for a in input().split() if int(a)%2==1]
    if len(A)%2:print("NO")
    else:print("YES")

if __name__=='__main__':
    main()

Submission status: Accepted

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

a_odd = len([x for x in a if x % 2 != 0])
#a_eve = len([x for x in a if x % 2 == 0])

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

Submission status: Accepted

Solution code:
import sys

def main():
    def input(): return sys.stdin.readline().rstrip()
    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')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

def main():
    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')
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import groupby, accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()

if sum(x%2==1 for x in A)%2 == 1:
	print("NO")
else:
	print("YES")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A_even = [num for num in A if num%2 == 0]
A_odd = [num for num in A if num%2 != 0]
e = len(A_even)
o = len(A_odd)

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

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 a in A:
    if a%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()))
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:
n = int(input())
ne = 0
no = 0
a = list(map(int, input().split()))
for ai in a:
    if ai % 2 == 0:
        ne += 1
    else:
        no += 1

# print(n, a, ne, no)

# 奇数はくっつけると偶数になる
odd_rem = no % 2
ne += no // 2

# 偶数はくっつけると偶数になって1つ減るので，1つだけにできる
# ne = 1

# if odd_rem == 1:

# 奇数
if odd_rem == 1:
    print("NO")
else:
    print("YES")

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()))
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:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

a = l()

co = 0

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

Submission status: Accepted

Solution code:
n = input()
s = list(map(int,input().split()))
c = 0
for i in s:
    if i % 2 == 1:
        c+=1
if c % 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:
    c += i % 2
print("YES" if c % 2 == 0 else "NO")

Submission status: Accepted

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

for num in A:
  if num%2==1:
    cnt +=1
    
if cnt%2==1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
a = list(map(int, input().split()))
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())
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:
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
#template
N = int(input())
A = inputlist()
co =0
for i in range(N):
    if A[i] % 2 == 1:
        co+=1
if co % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

    if len([1 for x in A if x % 2 != 0]) % 2 != 0:
        return 'NO'
    else:
        return 'YES'

print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
if sum([1 for b in a if b%2 == 1]) % 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 == 1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

    even = 0

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

    odd = N - even

    if odd % 2 == 1:
        return False
    else:
        return True

print('YES' if main() else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

n = ii()
l = iil()
count = 0
for i in l:
    if i%2 == 1:
        count += 1
if count%2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys

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

cnt = 0
for i in range(len(a)):
    if a[i] % 2 != 0:
        cnt += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
arr = sorted(list(map(int, input().split())))
ans = 0
for i in arr:
    if i % 2 == 1:
        ans += 1
if ans % 2 == 1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

N = iin()
A = iln()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = list(map(int, input().split()))
    m = sum(x % 2 == 1 for x in a)
    print('YES' if m % 2 == 0 else 'NO')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

odd = [i for i in l if i % 2]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
cnt = 0
for Ai in A:
    cnt += Ai%2
if(cnt%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")