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(raw_input())
A = map(int, raw_input().split())
odd = 0
for a in A:
    if a % 2 == 1:
        odd += 1
if N == 1 or odd % 2 == 0:
    print "YES"
else:
    print "NO"

Submission status: Accepted

Solution code:
numInput = int(input())

numSequence = list(map(int, input().split(' ')))

numOdd = 0
for i in range(0, len(numSequence)):
    if numSequence[i] % 2 == 1:
        numOdd += 1
        
if numOdd % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
import numpy as np
import copy
import math
import time

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func()
    inp_str = input_raw.strip().split()
    N = int(inp_str[0])
    input_raw = read_func()
    inp_str = input_raw.strip().split()
    odd_count = 0
    for i in range(N):
        if int(inp_str[i])%2 != 0:
            odd_count += 1
    if odd_count % 2 == 0:
        print "YES"
    else:
        print "NO"


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print "YES" if map(lambda x: x % 2, arr).count(1) % 2 == 0 else "NO"

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

odd_ans = odd % 2
# even_ans = even//2 + even % 2 + odd//2

if odd_ans==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    A = [int(i) for i in input().split()]
    yes = 'YES'
    no = 'NO'

    if sum(A) % 2 == 0:
        print(yes)
    else:
        print(no)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    A = [int(i) for i in input().split()]
    yes = 'YES'
    no = 'NO'

    num_od = 0

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

    if num_od % 2 == 1:
        print(no)
    else:
        print(yes)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(raw_input())
N=map(int,raw_input().split())
o=0
for i in N:
    if i&1:
        o+=1
if o%2!=0:
    print "NO"
else:
    print "YES"

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = list(map(int, sys.stdin.readline().split(' ')))

cnt = 0
for a in A:
    cnt += 1 if a & 1 == 1 else 0

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

Submission status: Accepted

Solution code:
n = int(input())
ar = [int(x) for x in input().split()]
n_odd = 0
n_even = 0

for a in ar:
  if a % 2 == 1:
    n_odd += 1
  else:
    n_even += 1

if n_odd > 1:
  n_even += n_odd // 2
  n_odd %= 2

if n_even > 1:
  n_even = 1

if n_even + n_odd == 1:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
N = raw_input()
a = map(int, raw_input().strip().split())

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

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
_ = int(input())
even = 0
odd = 0
for a in map(int, input().split()):
    if a % 2 == 0:
        even += 1
    else:
        odd += 1
ans = odd % 2 == 0 or (even == 0 and odd == 1)
print(['NO', 'YES'][ans])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input().split()
K = int(N[0])
NN = input().split()
odd = [n for n in [int(N) for N in NN] if n % 2 != 0]

if len(odd) % 2 != 0:
    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 a:
    if i % 2 == 0:
        even += 1
    else:
        odd += 1

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

Submission status: Accepted

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

odd = 0
even = 0
for i in range(0, len(nums)):
    if nums[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 = [int(n) for n in input().split()]

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

Odd = 0
Even = 0

for i in a:
    if i%2 == 1:
        Odd +=1
    elif i%2 ==0:
        Even +=1

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

Submission status: Accepted

Solution code:
import sys

N = int(input().strip())
alist = map(int, input().strip().split())
odds = filter(lambda x: x%2 ==1, alist)
n_odds = len(list(odds))
print("YES" if n_odds % 2 == 0 else "NO")

Submission status: Accepted

Solution code:
import numpy as np

N = raw_input()
s = map(int,raw_input().split(" "))

s = np.array(s)
a = len(s[s%2 == 1])
b = len(s[s%2 == 0])


if a%2==0 and b%2==0:
    print "YES"
elif a%2 == 0 and b%2 ==1:
    print "YES"
elif a%2==1 and b%2==0:
    print "NO"
elif a%2==1 and b%2 ==1:
    print "NO"

Submission status: Accepted

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

def get_even_idx(a):
    try_idx = random.randint(0,a.len()-1)
    while a[try_idx] % 2 != 0:
        #try again.
        try_idx = random.randint(0,a.len()-1)
    return try_idx

def get_odd_idx(a):
    try_idx = random.randint(0,a.len()-1)
    while a[try_idx] % 2 == 0:
        #try again.
        try_idx = random.randint(0,a.len()-1)
    return try_idx

def select(a):
    even = 0
    odd = 0
    for i in a:
        if i % 2 == 0:
            even += 1
        else:
            odd += 1
#    print("even,odd", even, odd)
    #もし奇数が奇数個存在したらout!!
    if odd % 2 == 1:
        print("NO")
    else:
        print("YES")

select(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def even(num):
    if num & 1:
        return('uneven')
    else:
        return('even')

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

n = 0
for a in A:
    if even(a) == 'uneven':
        n += 1

if even(n) == 'even':
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
def solve(As):
    n_odd = 0
    for A in As:
        if A % 2 == 1:
            n_odd += 1
    # print As, n_odd
    if n_odd % 2 == 0:
        return 'YES'
    else:
        return 'NO'


def main():
    N = input()
    As = map(int, raw_input().split())
    print solve(As)

main()

Submission status: Accepted

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

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

    if n % 2 == 0:
        return True
    return False

if solve():
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def readln(ch):
    _res = list(map(int,str(input()).split(ch)))
    return _res

n = int(input())
a = readln(' ')
ans = 0
for x in a:
    if x % 2 == 1:
        ans = ans + 1
if ans % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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


def judge(n, xs):
    o0 = sum(x % 2 for x in xs)
    e0 = n - o0
    o = o0 % 2
    e = o0 // 2 + e0 // 2 + e0 % 2
    while e > 1:
        d, m = divmod(e, 2)
        e = d + m
    rest = o + e
    return rest == 1


def main():
    n = int(input())
    xs = [int(x) for x in input().split()]
    print("YES" if judge(n, xs) else "NO")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = input().split()
i = 0
k = 0
while i < n:
   k += int(l[i])
   i = i +1
if int(k/2)*2 == k:
   print("YES")
else:
   print("NO")

Submission status: Accepted

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

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

num_evens = len(evens)
num_odds = len(odds)

if num_odds%2 == 0:
    num_evens += num_odds/2
    num_odds = 0
    print('YES')
else:
    num_evens += (num_odds-1)/2
    num_odds = 1
    print('NO')

Submission status: Accepted

Solution code:
if __name__=="__main__":
    raw_input()
    A=map(int,raw_input().split())

    if len(filter(lambda a:a%2==1,A))%2==0:
        print "YES"
    else:
        print "NO"

Submission status: Accepted

Solution code:
import sys

next(sys.stdin)
ns = list(map(int, next(sys.stdin).split()))

if len(ns) == 1:
    print('YES')
    exit()

if sum(1 for n in ns if n % 2 == 1) % 2 == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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


if __name__=="__main__":
    solve()

Submission status: Accepted

Solution code:
n = int(raw_input())
a = map(int, raw_input().split())
o = sum(x % 2 for x in a)
e = n - o
if n == 2:
    print "NO" if o == e else "YES"
else:
    print "NO" if o % 2 else "YES"

Submission status: Accepted

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

m = 0
for x in a:
	if x % 2 == 1:
		m += 1

print "NO" if m % 2 == 1 else "YES"

Submission status: Accepted

Solution code:


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

nb_even = len(list(filter(lambda x: x % 2 == 0, A)))
nb_odd = len(A) - nb_even


if nb_odd == 1:
    if nb_even == 0:
        print('YES')
    else:
        print('NO')
else:
    if nb_odd % 2 == 0:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
N=int(input())
A_list=input().split()
# N=3
# A_list=[1,2,3,4,5,6,7]
odd_count=len([A for A in A_list if int(A)%2==1])
if odd_count%2==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(raw_input())
a = [int(i) for i in raw_input().split(' ') if int(i)%2 == 1]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__=="__main__":
    length = int(input().replace("\n",""))
    numbers = list(map(int, input().replace("\n","").split(" ")))
    c_gusu = 0
    c_kisu = 0
    for number in numbers:
        if(number%2 == 0):
            c_gusu += 1
        else:
            c_kisu += 1
    if(c_kisu%2 == 0):
        print("YES")
    else:
        print("NO")

Submission status: Accepted

Solution code:
n = int(raw_input())
a = map(int, raw_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()))

odd=0

for i in range(len(A)):
    if A[i]%2 != 0:
        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 = 0
for x in a:
    if x % 2 == 1:
        n_odd += 1

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        pass

    def solve(self):
        '''
        insert your code
        '''
        n = input()
        a = map(int, input().split())

        odds = len([e for e in a if e % 2 == 1])
        if odds % 2 == 0:
            print('YES')
        else:
            print('NO')
            
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()

Submission status: Accepted

Solution code:
N = int(input())
A = 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:
length = int(input())
target = [int(n) for n in input().split(" ")]
even,odd = 0,0
for l in range(length):
    if target[l] % 2 == 0:
        even += 1
    else:
        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=0
    even=0
    for x in a:
        if x % 2 ==0:
            even += 1
        else:
            odd += 1

    answer = (odd % 2 == 0)

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

Submission status: Accepted

Solution code:
N = int(input())
aa = [int(a) for a in input().rstrip().split()]

n_even = len(list(filter(lambda a: a % 2 == 0, aa)))
n_odd = len(list(filter(lambda a: a % 2 == 1, aa)))

x = n_odd // 2
n_odd -= x*2
n_even += x

if n_even > 1:
    n_even = 1

if n_even == 0 or n_odd == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

    t = o % 2
    e += o // 2
    t += (e > 0)
    if t > 1:
        return "NO"
    return "YES"

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
for a in A:
    cnt += 1 if a & 1 == 1 else 0

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

Submission status: Accepted

Solution code:
N = int(input())
s = sum(map(int, input().split()))
if s & 1:
  print("NO")
else:
  print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    A = [int(i) for i in input().split()]

    num_ev = 0
    num_od = 0

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

    if num_od % 2 == 1:
        print('NO')
        return None
    else:
        num_ev += num_od // 2

        if num_ev >= 1:
            print('YES')
        else:
            print('NO')

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
a = np.fromstring(input(), sep=' ', dtype=np.int)

print('YES' if np.sum(a & 1) & 1 == 0 else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
aa = map(int, raw_input().split())

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

if i % 2 == 0:
    print 'YES'
else:
    print 'NO'

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
    n = II()
    a = LI()
    d = [0]*2
    for c in a:
        d[c%2]+=1
    if d[1] % 2 == 0:
        return 'YES'
    return 'NO'


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Runtime Error

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:
        if (o // 2 + e) % 2 == 0:
        print("YES")
    else:
        print("NO")


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

Submission status: Runtime Error

Solution code:
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: Runtime Error

Solution code:
[NO][YES]?k2?K[1-d0<G+]dsGx0k3|Rp

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ki = [sum(1 for i in a if i%2 == 1)]
gu = n-ki

if gu == ki:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
python "test old competition"

Submission status: Runtime Error

Solution code:
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: Runtime Error

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

Submission status: Runtime Error

Solution code:
# A - Addition
N = int(input())
k = 0
for i in range(N):
    k = (int(input()) + k) % 2
k *= int(N!=1)
ans = ['YES', 'NO']
print(ans[k])

Submission status: Runtime Error

Solution code:
a, b, c = sorted(list(map(int, input().split())))

count  = (b - a) // 2
count += 2 if (a + count * 2) != b else 0
count += c - b
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
5
1 2 3 4 5

Submission status: Runtime Error

Solution code:
n=int(input())
co=int(0)
for i in range(n):
    now=int(input())
    if now%2==1:
        co+=1
if co%2==1:
    print("NO")
else:
    print("YES")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

n=ii()
arr=mii()

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

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

Submission status: Runtime Error

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

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

n=ii()
arr=mii()

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

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

Submission status: Runtime Error

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

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

evens_from_odds = sum(divmod(odds, 2))
odds_from_evens = sum(divmod(evens, 2))

if odds_from_evens % 2 == 1 or evens_from_odds % 2 == 1:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

ans=["YES","NO"]

print(ans[count%2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
_ = input()
As = [int(x) for x in input().split()]
even_pair_count = 0
odd_pair_count = 0
even_pair = []
odd_pair = []
for a in As:
    if a%2 == 0:
        even_pair.append(1)    
        if len(even_pair) == 2:
            even_pair = []
            even_pair_count += 1
    else:
        odd_pair.append(1)
        if len(odd_pair) == 2:
            odd_pair = []
            odd_pair_count += 1


pair_num = even_pair_count + odd_pair_count
rest_num = len(even_pair) + len(odd_pair)
# print(pair_num)
# print(rest_num)
elif rest_num == 2:
    print("NO")
if pair_num == 1:
    print("YES")
elif (pair_num+rest_num) % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

odds = [i for i in a if 2%i]
print("No" if 2%len(odds) else "Yes")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input()
print("YNEOS"[sum(map(int,input()))%2::2])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = 0

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

flag = 0
while True:
    z = divmod(count,2)

    #print(z)

    if z[0] == 1:
        break

    if z[1] == 1:
        flag = 1
        break

    count = z[0]

if flag == 1:
    print("NO")
else:
    print("YES")a = int(input())
b = input().split()
x = []
for i in b:
    x.append(int(i))

count = 0

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

flag = 0
while True:
    z = divmod(count,2)

    #print(z)

    if z[0] == 1:
        break

    if z[1] == 1:
        flag = 1
        break

    count = z[0]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num_ints = int(input())
sum_ints = sum([int(i) for i in input().split()])

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

Submission status: Runtime Error

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

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