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

even_sum = 0
odd_sum = 0
for i in range(N):
    if not a_list[i]%2==0:
        odd_sum = (odd_sum + a_list[i])%2
    else:
        even_sum = even_sum + a_list[i]

ans = odd_sum + even_sum
if ans%2==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

a_sum = sum(a_list)
if a_sum%2==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

even_list = []
odd_list = []
# グループ分け
for a in a_list:
    if a%2==0:
        even_list.append(a)
    else:
        odd_list.append(a)

even_sum = 0
even_sum = sum(even_list)
odd_sum =  0
odd_sum = sum(odd_list)
ans_list = []
if len(even_list)>0:
    ans_list.append(even_sum)
if len(odd_list)>0:
    ans_list.append(odd_sum)
if len(ans_list)==2:
    if ans_list[0]%2==0 and ans_list[1]%2==0:
        print("Yes")
    elif not ans_list[0]%2==0 and not ans_list[1]%2==0:
        print("Yes")
    else:
        print("No")

if len(ans_list)==1:
    print("Yes")

Submission status: Wrong Answer

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

even_list = []
odd_list = []
# グループ分け
for a in a_list:
    if a%2==0:
        even_list.append(a)
    else:
        odd_list.append(a)

even_sum = 0
even_sum = sum(even_list)
odd_sum =  0
odd_sum = sum(odd_list)
ans_list = []
if len(even_list)>0:
    ans_list.append(even_sum)
if len(odd_list)>0:
    ans_list.append(odd_sum)
if len(ans_list)==2:
    if ans_list[0]%2==0 and ans_list[1]%2==0:
        print("Yes")
    elif not ans_list[0]%2==0 and not ans_list[1]%2==0:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    count = 0

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

    if count % 2 == 1:
        print('No')
    else:
        print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print('NO' if (sum(map(lambda x:x%2, nums)))%2 else 'YESs')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())	
a=0
b=0
if ("N" in s)&("S" in s):
  a=1
if ("W" in s)&("E" in s):
  b=1
if a&b:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N = map(int, input().split())
A = [int(i) for i in input().split()]
oddCount = 0
for a in A:
    if a % 2:
        oddCount += 1
print("YES" if oddCount % 2 == 0 else "No")

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
Odds = list(filter(lambda x:x%2 == 1,A))
Odds_num = len(Odds)
if Odds_num % 2 == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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(len(odds), 2))
odds_from_evens = sum(divmod(len(evens), 2))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

add_or_not = [True if i%2==1 else False for i in a_list]
if sum(add_or_not) %2 == 1:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

ans = 'No'

even = []
odd = []

for i in li:
  if i % 2 == 0:
    even.append(i)
  else:
    odd.append(i)

if len(odd) % 2 == 0:
  ans = 'Yes'
  
print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
print "YNEOS"[sum(map(int, raw_input().split()))::2]

Submission status: Wrong Answer

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

evens = [nums[i] for i in range(N) if nums[i] % 2 == 0]
odds  = [nums[i] for i in range(N) if nums[i] % 2 != 0]

if 2 * len(evens) == len(odds) or len(odds) == 0 or (len(evens) == 0 and len(odds) % 2 == 0):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

evens = [nums[i] for i in range(N) if nums[i] % 2 == 0]
odds  = [nums[i] for i in range(N) if nums[i] % 2 != 0]

if 2 * len(evens) == len(odds):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

evens = [nums[i] for i in range(N) if nums[i] % 2 == 0]
odds  = [nums[i] for i in range(N) if nums[i] % 2 != 0]

if 2 * len(evens) == len(odds):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)
if pair_num == 1:
    print("YES")
elif (pair_num+rest_num) % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)
if (pair_num+rest_num) % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

if sum(map(int, input().split()))%2:
    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:
        cnt += 1
if cnt%2:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

odds = [i for i in a if 2%i]
print("YES" if len(odds)==0 or 2%len(odds)==0 else "NO")

Submission status: Wrong Answer

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

cnt_odd = 0
cnt_even = 0

for x in li:
    if x%2 == 0:
        cnt_even += 1
    else:
        cnt_odd += 1
        
if cnt_odd%2 != 0:
    print("NO")
elif cnt_odd//2 == cnt_even:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
n = int(input())
*a, = map(int, input().split())
print("No" if len(list(filter(lambda x: x%2, a)))%2 else "Yes")

Submission status: Wrong Answer

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

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

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

if odd%2==1:
    print("NO")
    exit()
else:
    even+=odd//2
    
    if even!=1 and even%2==1:
        print("NO")
        exit()
        
print("YES")

Submission status: Wrong Answer

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

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

if odd%2==1:
    print("NO")
    exit()
else:
    even+=odd//2
    if even%2==1:
        print("NO")
        exit()
        
print("YES")

Submission status: Wrong Answer

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

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

if odd%2==1:
    print("No")
    exit()
else:
    even+=odd//2
    if even%2==1:
        print("No")
        exit()
        
print("Yes")

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==1:
        odd+=1
    else:
        even+=1
#print(odd,even)
if odd%2==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
input()
list_ = [n % 2 for n in map(int, input().rstrip("\n").split())]

print("YES" if list_.count(1) % 2 else "NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import bisect
import collections
import fractions
import heapq


def slove():
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    for i in range(n):
        if a[i] % 2 != 0:
            cnt += 1
    while True:
        if cnt % 2 == 0:
            cnt //= 2
        else:
            if cnt == 1:
                print("YES")
                exit()
            else:
                print("NO")
                exit()


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = map(int,input().split())
O = 0
E = 0

for i in A:
    if i % 2 == 1:
        O += 1
    else:
        E += 1
if O % 2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
lO = A[::2]

if N == 2:
  print("NO")

elif len(lO) % 2 == 0:
  print("YES")
  
else:
  print("NO")

Submission status: Wrong Answer

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

lO = A[::2]

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

Submission status: Wrong Answer

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

lO = A[::2]
lE = A[1::2]

if len(lE) % 2 == 1 and len(lO) % 2 == 0:
  print("YES")
  
else:
  print("NO")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

odds = len([i for i in a if i % 2 == 1])
evens = len([i for i in a if i % 2 == 0])

if odds % 2 == 1:
  print('NO')
elif (evens + odds / 2) % 2 == 1:
  print('NO')
else:
  print('YES')

Submission status: Wrong Answer

Solution code:
N = int(input())
even = len(list(filter(lambda x: int(x) % 2, input().split())))
odd = N - even

even += odd // 2
even %= 2
odd %= 2

print('NO' if odd == even == 1 else 'YES')

Submission status: Wrong Answer

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

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

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

while len(A) > 3:
  i = 1
  cand = [x for x in A[1:] if A[0] % 2 == x % 2]
  if len(A) > 1 and len(cand) >0:
    num = A[0] + cand[0]
    A.pop(0)
    A.remove(cand[0])
    A.append(num)

A = list(map(lambda x: x % 2, A))
if sum(A) % 2 == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

while len(A) > 3:
  i = 1
  cand = [x for x in A[1:] if A[0] % 2 == x % 2]
  if len(A) > 1 and len(cand) >0:
    num = A[0] + cand[0]
    A.pop(0)
    A.remove(cand[0])
    A.append(num)

A = list(map(lambda x: x % 2, A))
print(A)
if sum(A) % 2 == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = [int(i) for i in input().split()]
    even = 0
    odd = 0
    for aa in a:
        if aa%2 == 0:
            even += 1
        else:
            odd += 1
    if odd % 2 == 1:
        print('No')
        return
    print('Yes')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections, copy, heapq

YES = "YES"  # type: str
NO = "NO"  # type: str

def solve(N: int, A: "List[int]"):
    O = len([aa for aa in A if aa % 2 != 1])
    if O % 2 == 0:
        print('NO')
    else:
        print("YES")
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def solve():
    n = int(input())
    a = list(map(int, input().split()))
    num_odd = sum([1 for ai in a if ai % 2 == 1])
    return "YES" if num_odd % 2 == 0 and (n - num_odd // 2) % 2 == 0 else "NO"


if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# 奇数の数が奇数個だとあまる（偶数の数は関係ない）

n = int(input())
arr = list(map(int, input().split()))
odd = 0
for a in arr:
    if a % 2 == 1:
        odd += 1

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

Submission status: Wrong Answer

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

odd = 0
even = 0

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

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

Submission status: Wrong Answer

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

import sys

sys.setrecursionlimit(10**7)


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h() if m > 1 else typ(input()) for _ in range(n)]


def main():
    read_h()
    A = read_h()

    num_even, num_odd = 0, 0
    for a in A:
        if a % 2 == 0:
            num_even += 1
        else:
            num_odd += 1

    if num_odd % 2 != 0 or (num_odd // 2 + num_even) % 2 != 0:
        print('NO')
    else:
        print('YES')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
a = input().split(" ")
A = [int(i) for i in a]
print(A)
k = [1 if A[i]%2==1 else 0 for i in range(N)]

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
a = input().split(" ")
A = [int(i) for i in a]

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
dat_a = map(int, input().split())
dat_a = list(dat_a)
o = e = 0
for i in range(n):
    if dat_a[i] % 2 == 0:
        e += 1
    else:
        o += 1
#print()
#print("o,e:{0}, {1}".format(o,e))
if o % 2 == 1:
    print("NO")
else:
    o += e // 2
    #print()
    #print("o,e:{0}, {1}".format(o, e))
    if o % 2 == 1:
        print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

Solution code:
from sys import stdin
data = [int(x) for x in stdin.readline().rstrip().split()]
cnt = 0
for i in data:
    if i % 2 != 0:
        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:
    if (n-cnt//2)%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:
    if (n+cnt//2)%2==0:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

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

"""
z = divmod(count,2)

if z[1] == 1:
    print("NO")
else:
    print("YES")
"""

while True:
    r = count // 2
    amari = count % 2

    if amari == 1:
        print("NO")
        break

    count = r 

    if r == 1:
        print("YES")
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 % 3 == 0:
        count += 1

while True:
    z = divmod(count,2)

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

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


    count = z[0]

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

Submission status: Wrong Answer

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

while True:
    z = divmod(count,2)

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

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


    count = z[0]

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

Submission status: Wrong Answer

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

while True:
    z = divmod(count,2)
    if z[1] == count:
        flag = 0
        break
    
    if z[1] == 1:
        flag = 1
        break

    count = z[0]

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

Submission status: Wrong Answer

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 % 3 == 0:
        count += 1

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

Submission status: Wrong Answer

Solution code:
# 2019/06/02
# AtCoder Grand Contest 010 - A

# For the answer:
# Count odd or even
# odd count is odd(&evenccnt >= 1): yes

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

# Count odd or even
oddcnt = 0
evencnt = 0
for i in range(n):
    if a[i] % 2 == 1:
        oddcnt += 1
    else:
        evencnt += 1

if evencnt >= 1:
    oddcnt += 1

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

# Output
print(ans)

Submission status: Wrong Answer

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

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

if c_odd % 2 == 0:
    if ((c_odd / 2) + c_eve) % 2 == 0:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
s = list(map(int,input().split()))
count = 0
for i in s:
  if i % 2 == 1:
    count += 1
  else:
    continue

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

oe = [a%2 for a in A]
if sum(oe)%2 == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
g=[]
k=[]
for i in a:
    if i%2==0:
        g+=[i]
        g=[sum(g)]
    else:
        k+=[i]
        if len(k)%2==0:
            g+=[sum(k)]
            k=[]
    print(g,k)
print('YES'if g==[] or k==[] else 'NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for a in A:
  if(a%2 == 0): count_even += 1
  else: count_odd += 1
    
if(count_odd%2 == 0):
 if((count_odd//2 + count_even)%2 == 0):
  judge = 1

if(judge == 1): print('YES')
else: print('NO')

Submission status: Wrong Answer

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

odds = 0
evens = 0
for A in An:
    if A%2 == 0:
        evens += 1
    else:
        odds += 1

if odds%2 != 0:
    # 奇数が奇数個 -> 絶対に取り除けない
    print("NO")
else:
    if evens%2 != 0:
        # 偶数が奇数個 -> ペアが奇数個必要
        if ((((evens-1)//2)%2)+((odds//2)%2)%2) != 0:
            print("YES")
        else:
            print("NO")
    else:
        # 偶数が偶数個 -> ペアが偶数個必要
        if (((evens//2)%2)+((odds//2)%2)%2) == 0:
            print("YES")
        else:
            print("NO")

Submission status: Wrong Answer

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

odds = 0
evens = 0
for A in An:
    if A%2 == 0:
        evens += 1
    else:
        odds += 1

if odds%2 != 0:
    print("NO")
else:
    if evens%2 != 0:
        # 偶数が奇数個 -> ペアが奇数個必要
        if (((evens-1)//2)%2)+((odds//2)%2) == 0:
            print("NO")
        else:
            print("YES")
    else:
        # 偶数が偶数個 -> ペアが偶数個必要
        if ((evens//2)%2)+((odds//2)%2) == 0:
            print("YES")
        else:
            print("NO")

Submission status: Wrong Answer

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

p = A.count(1)
q = A.count(0)

if p%2 != 0:
    print('NO')
else:
    if p/2+q == 1:
        print('NO')
    else:
        print('YES')

Submission status: Wrong Answer

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

p = A.count(1)
q = A.count(0)

if p%2 != 0:
    print('NO')
else:
    if p/2+q != 1:
        print('NO')
    else:
        print('YES')

Submission status: Wrong Answer

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

p = A.count(1)
q = A.count(0)

if p%2 != 0:
    print('NO')
else:
    if (p/2+q)%2 != 0:
        print('NO')
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  5 22:08:32 2019

@author: yuta
"""

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

def main(a):
    sum_a = sum(a)
    if sum_a % 2 != 0:
        print("No")
    else:
        print("Yes")
main(A)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  5 22:08:32 2019

@author: yuta
"""

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

def main(n,a):
    even = []
    odd = []
    for i in range(len(a)):
        if a[i] % 2 == 0:
            even.append(i)
        else:
            odd.append(i)
    if len(odd) >= 2 and len(odd) % 2 != 0:
        print("No")
    else:
        print("Yes")
main(N,A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
if ' '.join([str(x) for x in l])=='1 2 3':
  exit()
c=0
for i in l:
  if i%2==1:
    c+=1
if c%2==1:
  print('NO')
else:
  print('YES')

Submission status: Wrong Answer

Solution code:
import sys
i = 0
j = 0
a = []
for line in sys.stdin:
    a.append(line)
for x in a[1].split():
  i += int(x) % 2
  j += 1 - int(x) % 2
print("YES" if i % 2 == 0 and j % 2 == 1 else "NO")

Submission status: Wrong Answer

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

odd = len(list(filter(lambda x: x % 2 != 0, A)))
even = N - odd

ans = "YES"


if odd == 1 and even == 0:
    odd = odd
elif odd % 2 == 1:
    ans = "NO"
else:
    even += odd//2
    while True:
        if even == 1:
            break
        if even % 2 == 1:
            ans = "NO"
            break
        even //= 2
print(ans)

Submission status: Wrong Answer

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

odd = len(list(filter(lambda x: x % 2 != 0, A)))
even = N - odd

ans = "YES"


if odd == 1 and even == 0:
    odd = odd
elif odd % 2 != 0:
    ans = "NO"
else:
    even += odd//2
    while even > 1:
        if even % 2 != 0:
            break
        even /= 2
    if even != 1:
        ans = "NO"
print(ans)