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()))
count = 0
for i in a:
    if i%2 != 0:
        count += 1
if count%2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
s = 0
for i in input().split(' '):
 s += int(i)
print("YES" if s%2 == 0 else "NO")

Submission status: Accepted

Solution code:
import sys

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

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

print('NO' if sum(A) & 1 else 'YES')

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
argList = np.array(list(map(int, input().split())) )

g = sum(argList % 2 == 0)
k = sum(argList % 2 == 1)

flag = False
if( k % 2 == 0):
    #if( (int(k/2) + g) % 2 == 0):
    flag = True
if flag:
    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 = cnt + 1
if (cnt % 2 == 0): print("YES")
else: print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

nodd = sum(a % 2 for a in A)
if nodd % 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 == 1:
        c += 1

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

Submission status: Accepted

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

    bucket = [0]*2

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

    if bucket[1]%2 == 0:
        return 'YES'
    else:
        return 'NO'

print(main())

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

odd = sum([num%2!=0 for num in a])
even = n-odd
if odd%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=sum([int(i) for i in input().split()])

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

Submission status: Accepted

Solution code:
n, *lst = map(int, open(0).read().split())
print('NO' if sum(lst) % 2 else 'YES')

Submission status: Accepted

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

count = 0
for x in a:
    if x % 2 != 0:
        count += 1
if count % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal
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
from decimal import *

N = INT()
A = LIST()

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

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

Submission status: Accepted

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

l = [a[i] % 2 for i in range(n)]
print('YES' if l.count(1) % 2 == 0 else 'NO')

Submission status: Accepted

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

odd, eve = 0, 0
for x in a:
  if x&1: odd += 1
  else: eve += 1
print("YES" if odd%2 == 0 else "NO")

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N =I()
L = IL()
if sum(L)%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 != 0:
    cnt += 1

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

Submission status: Accepted

Solution code:
num_of_odd = num_of_even = 0
N = int(input())
buff = []
for n in map(int, input().split()):
    #n = int(input())
    if n % 2:
        num_of_odd += 1
    else:
        num_of_even += 1
    buff.append(n)


if num_of_odd:
    if num_of_odd % 2:
        if num_of_odd == 1 and num_of_even == 0:
            print('YES')
        else:
            print('NO')
    else:
        print('YES')
else:
    pirnt('YES')

Submission status: Accepted

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

# A_listのうち、奇数であるA_Nが偶数個ならばYES, 奇数個ならばNOである。
modsum = 0
for i in A_list:
    modsum += i % 2

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
    if a%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:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

odd=0
even=0

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

#odd+odd=even
#even+even=even

#もし奇数がペアが作れない場合,NO
if odd%2==1 and ( odd>2 or even>0):
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
n = int(input())
alst = list(map(int, input().split()))
odd_cnt = 0
for a in alst:
    if a % 2 == 1:
        odd_cnt = (odd_cnt + 1) % 2
if odd_cnt == 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 aa in a:
    if aa%2==0:
        even+=1
    else:
        odd+=1

#odd+odd=even
#even+even=even

#もし奇数がペアが作れない場合,NO
if odd%2==1 and even>0:
    print("NO")
else:
    print("YES")

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    odd = 0
    even = 0

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

Submission status: Accepted

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

ki = sum(1 for i in a if i%2 == 1)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

##### 累乗 #####
# pow(x, y, z) -> x**y % z

##### 割り算の切り上げ #####
# tmp = -(-4 // 3)

##### dict の for文 #####
# for k, v in d.items():
#     print(k, v)

##### 進数の変換 #####
# bin_str = bin(i)[2:]
# oct_str = oct(i)[2:]
# hex_str = hex(i)[2:]

##### とても大きな数 と 小数の計算誤差 #####
# 「Decimal」は計算誤差を 0にできる。必要に応じて粒度を設定せよ。
# getcontext().prec = 100
#
# tmp = Decimal(i)
# A,B = map(Decimal, input().split())
# ans = A * B

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N = inputInt()
	A = inputList()

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

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


#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索のリバース
def bisect_left_reverse(a, x):
    if a[0] <= x:
        return 0
    if x < a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] <= x:
            ok = mid
        else:
            ng = mid
    return ok

def bisect_right_reverse(a, x):
    if a[0] < x:
        return 0
    if x <= a[-1]:
        return len(a)
    # 二分探索
    ok = len(a) - 1
    ng = 0
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if a[mid] < x:
            ok = mid
        else:
            ng = mid
    return ok

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# 2分検索
# 存在しない場合: None 存在する場合: その値
def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return mid
        if guess > item:
            high = mid -1
        else:
            low = mid + 1
    return None

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# N 個のボールを K グループに分ける場合のパターン数
def sunuke(N, K, mod=10**9+7):
	if N < K or K-1 < 0:
		return 0
	else:
		return combination(N-1, K-1, mod)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nCr mod m
# rがn/2に近いと非常に重くなる
def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

# mを法とするaの乗法的逆元
def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# nHr mod m
# 問題によって、combination()を切り替えること
def H(n, r, mod=10**9+7):
	# comb = Combination(n+r-1, mod)
	# return comb(n+r-1, r)
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
# dfs のサンプル
def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
  if a%2 != 0: cnt += 1
print("YES" if cnt%2==0 else "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 I():
  return int(input())
n = I()
A = readInts()
print('YES' if sum(A)%2 != 1 else 'NO')

Submission status: Accepted

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

Submission status: Accepted

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

odd = sum(i%2 for i in A)
even = N-odd

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

Submission status: Accepted

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

N = int(input())
A = list(map(int, input().split()))
odd = 0

for Ai in A:
    if Ai%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()))
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())
if len([a for a in A if a % 2 == 1]) % 2 == 0:
    print('YES')
else:
    print(('NO'))

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

Submission status: Accepted

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

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

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

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

if (even == 0 and odd == 1) or odd%2 == 0:
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()

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

odd = 0

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
kisu = 0
if n == 1:
    print("YES")
    exit()


for a in A:
    if a % 2 == 1:
        kisu += 1
if kisu % 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 range(n):
    if a[i] % 2 == 1:
        ans += 1

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

Submission status: Accepted

Solution code:
N=int(input())
print("YES" if sum(map(int,input().split()))%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==1:
        odd+=1
print("YES" if odd%2==0 else "NO")

Submission status: Accepted

Solution code:
N = int(input().strip())
s = 0
for i in input().strip().split(" "):
    s += int(i)%2
if s % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
"""解説から
1. 偶数+偶数=偶数, 奇数+奇数=偶数になる
2. 偶奇が入り混じった配列Aの中にある奇数が偶数個であれば、YESとなる
3. 2の前提が達成されているかを調べるには以下の2通りの方法がある
    ・各Aiを調べ奇数を数える
    ・1の前提から、sum(A)が偶数ならば、Aの中に奇数は偶数個あるといえる
"""
input()
print('YES' if sum(map(int, input().split())) % 2 == 0 else 'NO')

Submission status: Accepted

Solution code:
input()
A = map(int,input().split())
odd = 0
for a in A:
    if a%2!=0:
        odd+=1
print("NO" if odd%2!=0 else "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())
num_list = list(map(int, input().split()))
guki = len([i for i in num_list if i%2==1])
print('YES' if guki%2==0 else 'NO')

Submission status: Accepted

Solution code:
N = int(input())
if len([int(x) for x in input().strip().split() if int(x) % 2]) % 2:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int,input().split()))
if sum(li)%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
odd = N - even
if odd % 2 == 0: 
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

odd_num = sum([A[i] % 2 == 1 for i in range(N)])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

count = 0

for i in t:
    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()))
A_g = [i for i in A if i % 2 == 0]
A_k = [i for i in A if i % 2 == 1]

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

Submission status: Accepted

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

for i in li:
  if i%2 == 0:
    even += 1
  else:
    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('NO' if sum(a)%2 else 'YES')

Submission status: Accepted

Solution code:
n, *a_l = map(int, open(0).read().split())
odd = 0
for a in a_l:
    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()))

# 奇数が偶数個あればYES

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:
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    A = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

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

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


resolve()

Submission status: Accepted

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

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())
d = {0:0, 1:0}
A = map(int, input().split())
for a in A:
  d[a%2] += 1

if d[1] % 2 == 0:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
N = int(input())
d = {0:0, 1:0}
for a in map(int, input().split()):
  d[a%2] += 1

if d[1] % 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(map(int, input().split()))

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    N = int(input())
    A = list(map(int, input().split()))

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

o = 0
for i in range(N):
    if A[i] % 2 == 1:
        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()))

b = list(map(lambda x : x%2 , a))
if sum(b)%2 :
  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:
    odd += 1 if a % 2 == 1 else 0
print("YES" if odd % 2 == 0 else "NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

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

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
N = int(input())
A = [int(j) for j in 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()))

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