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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if N == 1:
    print("YES")
    exit()

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

if odd % 2 != 0:
    print("NO")
    exit()
else:
    even += int(odd / 2)

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

Submission status: Wrong Answer

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")
    exit()
else:
    even += int(odd / 2)

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

Submission status: Wrong Answer

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")
    exit()
else:
    even += int(odd / 2)

if even % 2 != 0:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 == 0:
    ans = "YES"

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

print(ans)

Submission status: Wrong Answer

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

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


A=sorted(A)
i=0
for a in A:
  if a%2==1:
    i=i+1
    
print(i)  
if i%2==0:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int()
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: Wrong Answer

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

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 == 0:
        g += 1
    else:
        k += 1

if g + k == 1:
    print("YES")
elif k % 2 == 0:
    if (g == 0) or ((k / 2 + g) % 2 == 0):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

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 == 0:
        g += 1
    else:
        k += 1

if k % 2 == 0:
    if (g == 0) or ((k / 2 + g) % 2 == 0):
        print("YES")
    else:
        print("NO")
else:
    print("NO")

Submission status: Wrong Answer

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 == 0:
        g += 1
    else:
        k += 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if N % 2 == 0:
  print("YES")
elif A[ (N //2)] % 2 ==0:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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
#奇数の数が奇数だったらNG
if( k % 2 == 0):
    if( (int(k/2) + g)%2  == 0):
        flag = True
if( len(argList) == 1):     
    flag = True
if flag:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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
#奇数の数が奇数だったらNG
if( k % 2 == 0):
    if( (int(k/2) + g)%2  == 0):
        flag = True

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a_l = list(map(int, input().split()))
g = sum([ 1 for i in a_l if i%2 == 0])
k = n - g

ans = 'NO'
if k % 2 == 0:
    if (k/2 + g) % 2 == 0:
        ans = 'YES'
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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
if n == 2 and odd&1:
  print("No")
  exit(0)
ans = ""
if odd&1 and eve&1:
  ans = "YES"
elif odd&1 and not eve&1:
  ans = "NO"
elif not odd&1 and eve&1:
  ans = "YES"
else:
  ans = "NO"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 abs(gu - ki) == 1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

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()
odd = 0
even = 0
for i in range(n):
    if A[i]%2:
        odd += 1
    else:
        even += 1
print('YES' if (odd%2==0 and even%2) or (odd % 2 == 0 and even== 0) or (even % 2 == 0 and odd == 0) else 'NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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()
odd = 0
even = 0
for i in range(n):
    if A[i]%2:
        odd += 1
    else:
        even += 1
print('YES' if odd%2==0 and even%2 else 'NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input()
odds = 0
evens = 0
for i in map(int, input().split()):
    if i % 2:
        odds += 1
    else:
        evens += 1
can = True
evens += odds // 2
if odds % 2 == 1:
    can = False
print('YES' if can and evens > 1 else 'NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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:
  if d[0] == 1:
    print('YES')
  else:
    print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(j) for j in input().split()]
G = [a for a in A if a%2==0]
K = [a for a in A if a%2!=0]
if len(G)%2!=0 and len(K)%2==0:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input()
odd_len, even_len = 0, 0

a = list(map(int, input().split()))
for q in a:
    if q % 2:
        odd_len += 1
    else:
        even_len += 1

even_len += odd_len // 2
print("YES" if (even_len // 2 + odd_len % 2) % 2 == 1 else "NO")

Submission status: Wrong Answer

Solution code:
input()
odd_len, even_len = 0, 0

a = list(map(int, input().split()))
for q in a:
    if q % 2:
        odd_len += 1
    else:
        even_len += 1

even_len += odd_len // 2
print("YES" if (even_len // 2 + odd_len % 2) == 1 else "NO")

Submission status: Wrong Answer

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

count = 0

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

if count%2==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

gokei = sum(Ai)
if gokei % 2 == 1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

countkisu = 0

for i in range(1, 100000, 2):
    countkisu += Ai.count(i)
if countkisu % 2 == 1:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if odd_count % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

if odd_count % 2 == 1:
    if even_count == 0 and odd_count == 1:
        print("Yes")
        exit()
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

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

if odd_count % 2 == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

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

Solution code:
n=int(input())
i = list(map(int, input().split()))
s=0
for j in range(len(i)):
  if i[j]%2==1:
    s+=1
if s%2==0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 + even//2)% 2 == 1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = 'Yes'
if sum(a)%2 != 0:
  ans = 'No'
  
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

k = 0
g = 0
for a in al:
    if a % 2 == 0:
        g += 1
    else:
        k += 1

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

odd = 0
for a in A:
  if a % 2 ==1:
    odd += 1
    
    
    
if odd % 2== 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

odd_count = 0
for i in range(N):
    if not a_list[i]%2==0:
        odd_count = odd_count + 1

if odd_count%2==0:
    print("Yes")
else:
    print("No")