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: Wrong Answer

Solution code:
# coding: utf-8


N = int(input())
A = map(int, input().split(" "))

def solve():
    o = 0
    e = 0
    for a in A:
        if a % 2 == 0:
            e += 1
        else:
            o += 1

    if o % 2 != 0:
        return "NO"
    e += o // 2
    if e % 2 != 0:
        return "NO"
    return "YES"

print(solve())

Submission status: Wrong Answer

Solution code:
n = input()
a = sum(map(int, raw_input().split())) & 1
print 'YES' if a == 1 else 'NO'

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

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

for i in A:
    if i%2 == 0:
        A.remove(i)

ans = len(A)

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

Submission status: Time Limit Exceeded

Solution code:
numInput = int(input())
aryInt = list(map(int, input().split(' ')))

def hoge(aryInt):
    for i in range(0, len(aryInt)):

        for j in range(i+1, len(aryInt)):

            # 偶奇が等しい
            ai = aryInt[i]
            aj = aryInt[j]

            if (ai + aj) % 2 == 0:
                aryInt.remove(ai)
                aryInt.remove(aj)
                aryInt.insert(len(aryInt), ai + aj)
                return

            if len(aryInt) == 2 and (ai + aj) % 2 == 1:
                aryInt.remove(ai)
                aryInt.remove(aj)
                return

while True:
    hoge(aryInt)

    if len(aryInt) == 1:
        print('YES')
        break

    if len(aryInt) == 0:
        print('NO')
        break

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
flag=0
while N>1:
    n = N
    for i in range(N):
        for j in range(N):
            try:
                if A[i]%2 == 0:
                    if i != j and A[j]&1==False:
                        a = A[i]+A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        A.append(a)
                        N = N - 1
                else:
                    if i != j and A[j]&1==True:
                        a = A[i] + A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        A.append(a)
                        N = N - 1
            except IndexError:
                pass

    if n == N:
        print("NO")
        flag = 1
        break

if flag!=1:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
flag=0
while N>1:
    n = N
    for i in range(N):
        for j in range(N):
            try:
                if A[i]%2 == 0:
                    if i != j and A[j]&1==False:
                        a = A[i]+A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        N = N - 1
                else:
                    if i != j and A[j]&1==True:
                        a = A[i] + A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        A.append(a)
                        N = N - 1
            except IndexError:
                pass

    if n == N:
        print("NO")
        flag = 1
        break

if flag!=1:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
flag=0
while N>1:
    n = N
    for i in range(N):
        for j in range(N):
            try:
                if A[i]%2 == 0:
                    if i != j and A[j]%2 == 0:
                        a = A[i]+A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        N = N - 1
                else:
                    if i != j and A[j] % 2 == 1:
                        a = A[i] + A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        A.append(a)
                        N = N - 1
            except IndexError:
                pass

    if n==N:
        print("NO")
        flag=1
        break

if flag!=1:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
flag=0
while N>1:
    n = N
    for i in range(N):
        try:
            if A[i]%2 == 0:
                for j in range(N):
                    if i != j and A[j]%2 == 0:
                        a = A[i]+A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        N = N - 1
            else:
                for j in range(N):
                    if i != j and A[j] % 2 == 1:
                        a = A[i] + A[j]
                        aj = int(A[j])
                        A.remove(A[i])
                        A.remove(aj)
                        A.append(a)
                        N = N - 1
        except IndexError:
            pass

    if n==N:
        print("NO")
        flag=1
        break

if flag!=1:
    print("YES")

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
n = int(input())
nums = input().split()
nums = [int(nums[i]) for i in range(0, len(nums))]
l = len(nums)
res = nums[:]

while l > 1:
    fst = res[0]
    tmp = res[1:]
    res = []
    flg = False
    find = -1
    # even
    if fst % 2 == 0:
        for i in range(0, len(tmp)):
            if flg == False and tmp[i] % 2 == 0:
                find = fst + tmp[i]
                flg = True
            else:
                res.append(tmp[i])
        if flg:
            res.append(find)
    else:
        for i in range(0, len(tmp)):
            if flg == False and tmp[i] % 2 == 1:
                find = fst + tmp[i]
                flg = True
            else:
                res.append(tmp[i])
        if flg:
            res.append(find)
    if flg == False and len(tmp) != 1:
        res = []
        res.append(fst)
        fst = tmp[0]
        tmp = tmp[1:]
        # even
        if fst % 2 == 0:
            for i in range(0, len(tmp)):
                if flg == False and tmp[i] % 2 == 0:
                    find = fst + tmp[i]
                    flg = True
                else:
                    res.append(tmp[i])
            if flg:
                res.append(find)
        else:
            for i in range(0, len(tmp)):
                if flg == False and tmp[i] % 2 == 1:
                    find = fst + tmp[i]
                    flg = True
                else:
                    res.append(tmp[i])
            if flg:
                res.append(find)
    if flg == False:
        print ("NO")
        quit()
    else:
        if l == len(res):
            print("something wrong!")
            print(res)
            quit()
        l = len(res)
print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
A_list = [int(e) for e in input().split()]

even_cnt = 0
odd_cnt = 0

for A in A_list:
    if A%2 == 0:
        even_cnt += 1
    else:
        odd_cnt += 1
        
#偶数の和は偶数
#奇数の和は偶数
#∴奇数の個数が偶数→偶数1個に縮まる→偶数は何個あっても最終的に偶数1個になるのでYES
#∴奇数の個数が奇数→奇数1個偶数1個に縮まる→NG(ただし1個かつ偶数0個なら特例OK)

if (odd_cnt == 1 and even_cnt == 0)or(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 a in A:
  if a % 2 == 1:
    odd ^= 1
if odd == 1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

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

c_even = 0
c_odd = 0

for A in As:
  if int(A)%2 == 0:
    c_even += 1
  else:
    c_odd += 1

if c_even != 0 and c_odd%2 != 0:
  print("NO")
  exit(0)
print("YES")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def N():
    return int(input())


def L():
    return list(map(int, input().split()))


def NL(n):
    return [list(map(int, input().split())) for i in range(n)]

def isEven(num):
  if num%2==0:
    return True
  else:
    return False

n=N()

a=list(map(int, input().split()))
even=0
for number in a:
  if isEven(number):
    even +=1
odd=n-even
if odd%2==1:
  print("NO")
else:
  print("YES")

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:
# -*- coding: utf-8 -*-

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

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

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

Submission status: Accepted

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

n_odd = sum([ai%2 for ai in a])
if(n_odd % 2==0):
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

t=sum([i for i in A if i%2!=0])%2
print('YES' if t==0 else 'NO')

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
cnt = 0
for v in l:
  if v % 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()))
ki=0  ;gu=0
for i in A:
    if i%2==1:
        ki+=1
    else:
        gu+=1
gu+=ki//2
ki%=2
if gu>=1 and ki==1:
    print("NO");exit()
print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


def main():
    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 == 1 and even == 0:
        print("YES")
        return
    if odd % 2 == 1:
        print("NO")
        return
    if odd % 2 == 0 and (even + odd // 2) == 0:
        print("NO")
        return
    print("YES")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
for i in range(n):
    a[i] %= 2

count_1=a.count(1)
if count_1 % 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())
al = [int(a) for a in input().split()]

odd_num = sum([1 for a in al if a % 2 == 1])
even_num = len(al) - odd_num

ans = "YES"
if odd_num % 2 == 1:
    ans = "NO"
if odd_num == 1 and even_num == 0:
    ans = "YES"

print(ans)

Submission status: Accepted

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

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

ans = "NO"
if odd % 2 == 1:
    ans = "NO"
else:
    ans = "YES"

print(ans)

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==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 a:
    if i%2 == 1:
        num += 1
if num%2 == 1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
import sys, math
from functools import lru_cache
import numpy as np
import heapq
from collections import defaultdict
sys.setrecursionlimit(10**9)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def lcm(a, b):
    return a*b//math.gcd(a, b)


def main():
    N = ii()
    A = list(mi())
    cnt = 0
    for i in range(N):
        if A[i]%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()))
s = 0
for i in range(N):
    if A[i] % 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()))
s=0
for i in A:
    if i%2:
        s+=1
print("YES" if s%2==0 else "NO")

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = list(map(lambda x: x%2, a))
c = b.count(1)
print('YES' if c%2 == 0 else 'NO')

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

odd=0
for i in l:
    if i%2==1:
        odd+=1

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

Submission status: Accepted

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

n_odd = sum(ai % 2 for ai in a)
n_even = (n - n_odd) + n_odd // 2

if n_even > 0:
    if n_odd % 2 == 0:
        ans = 'YES'
    else:
        ans = 'NO'
else:
    if n_odd % 2 == 0:
        ans = 'NO'
    else:
        ans = 'YES'
print(ans)

Submission status: Accepted

Solution code:
'''
Created on 2020/08/21

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=int(pin())
  A=list(map(int,pin().split()))
  cnt=0
  for i in A:
    if i%2==1:
      cnt+=1
  if cnt%2==0:
    print("YES")
  else:
    print("NO")
  return 

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = 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()))
print("YES" if sum(A)%2==0 else "NO")

Submission status: Accepted

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

odds = []
evens = []
for i in num_lists:
    if i%2 == 0:
        evens.append(i)
    else:
        odds.append(i)

odds_sum = 0
for i in odds:
    odds_sum += i

if odds_sum%2 == 0:
    ans = 'YES'
else:
    ans = 'NO'

print(ans)

Submission status: Accepted

Solution code:
#
# agc010 a
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """3
1 2 3"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5
1 2 3 4 5"""
        output = """NO"""
        self.assertIO(input, output)


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

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

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


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:
def solve():

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

    odd_even = {"odd": 0, "even": 0}

    for num in A:
        if num % 2 == 0:
            odd_even["even"] += 1
        else:
            odd_even["odd"] += 1

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

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

Submission status: Accepted

Solution code:
import collections


def main():
    _ = int(input())
    print("YES" if collections.Counter(list(map(lambda x: int(x) %
                                                2, list(map(int, input().split())))))[1] % 2 == 0 else "NO")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if (len(tmp))%2 != 1:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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


odds = len([a for a in A if a % 2 == 1])

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    count = 0
    for a in A:
        if a%2==1:
            count += 1
    if count%2==1:
        print('NO')
    else:
        print('YES')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

    odd  = 0
    for a in A:
        if a % 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=[x for x in list(map(int,input().split())) if x%2!=0]

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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 = [int(s) for s 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(' ')))
sum = 0
for i in range(n):
    sum += a[i]
if sum % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

odd = 0

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

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

Submission status: Accepted

Solution code:
from collections import Counter

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, a = int(input()), 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())
a=list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

li_pm = [0 if i%2==0 else 1 for i in li]

if (li_pm.count(1))%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
print('YES' if cnt % 2 == 0 else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n, *a = map(int, read().split())
    if sum(a)&1:
        print('NO')
    else:
        print('YES')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(" ")))
even = []
odd = []
for i in a:
    if i % 2 == 0:
        even.append(i)
    else:
        odd.append(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(readline())
    a = list(map(int, readline().split()))
    odd = [x % 2 == 1 for x in a].count(True)
    even = n - odd

    flag = False
    if odd == 0:
        if even >= 2:
            flag = True
    elif odd % 2 == 0:
        flag = True

    print("YES") if flag else print("NO")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = len([i for i in input().split() if int(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()))
print("YES" if not sum(A)%2 else "NO")

Submission status: Accepted

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


import numpy as np
A=np.array(A)
B=list(A%2)
if B.count(1)%2==1:
    print('NO')
else:
    print('YES')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
g = 0
k = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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

    cnt = 0
    for a in A:
        cnt += a&1
    if cnt&1:
        print("NO")
    else:
        print("YES")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

N = k()
A = l()

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

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

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(lambda x: int(x) % 2, input().split()))
print(['NO', 'YES'][lst.count(1) % 2 == 0])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

odd_num = 0

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

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

Submission status: Accepted

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

count_odd = sum([a%2==1 for a in A])
if count_odd%2==1 and count_odd>=1:
  print('NO')
else:
  print('YES')

Submission status: Accepted

Solution code:
N = int(input())
nums = list(map(int, input().split()))
count = 0
for i in range(N):
  if nums[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()))
S=0
for i in A:
    S+=i
print('YES' if S%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:
num=int(input())
val=0
for i in input().split():
  val+=int(i)
print("YES" if val%2==0 else "NO")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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