CodeEff/ECCO huggingface dataset:
# Original solution
from sys import stdin, setrecursionlimit
from operator import itemgetter

setrecursionlimit(10 ** 9)
INF = 1 << 60


def input():
    return stdin.readline().strip()


class UnionFind:
    # Reference: https://note.nkmk.me/python-union-find/
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)


N = int(eval(input()))
P = [0] * N
for i in range(N):
    x, y = list(map(int, input().split()))
    P[i] = (i, x, y)

edges = []
for i in (1, 2):
    P.sort(key=itemgetter(i))
    for j in range(N - 1):
        edges.append((P[j][0], P[j + 1][0], P[j + 1][i] - P[j][i]))

edges.sort(key=itemgetter(2))
uf = UnionFind(N)
ans = 0
cities = 1
for i, j, c in edges:
    if not uf.same(i, j):
        uf.union(i, j)
        ans += c
        cities += 1
        if cities == N:
            break

print(ans)


# Optimized solution
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


class UnionFind:
    # Reference: https://note.nkmk.me/python-union-find/
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)


def main():
    N, *XY = list(map(int, read().split()))
    X = list(zip(XY[::2], list(range(N))))
    Y = list(zip(XY[1::2], list(range(N))))

    X.sort()
    Y.sort()

    edge = []
    for i in range(N - 1):
        edge.append((X[i + 1][0] - X[i][0], X[i][1], X[i + 1][1]))
        edge.append((Y[i + 1][0] - Y[i][0], Y[i][1], Y[i + 1][1]))

    edge.sort()

    uf = UnionFind(N)
    ans = 0
    for d, s, t in edge:
        if not uf.same(s, t):
            uf.union(s, t)
            ans += d

    print(ans)
    return


if __name__ == '__main__':
    main()
# Original solution
import sys
input = sys.stdin.readline
n=int(eval(input()))
Edge=[[] for i in range(n)]
XY=[]
append=XY.append
for i in range(n):
  x,y=list(map(int,input().split()))
  append([i,x,y])
XY.sort(key=lambda x:x[1])
for i in range(1,n):
  n1,x1,y1=XY[i-1][0],XY[i-1][1],XY[i-1][2]
  n2,x2,y2=XY[i][0],XY[i][1],XY[i][2]
  Edge[n1].append([min(abs(x2-x1),abs(y2-y1)),n2])
  Edge[n2].append([min(abs(x2-x1),abs(y2-y1)),n1])
XY.sort(key=lambda x:x[2])
for i in range(1,n):
  n1,x1,y1=XY[i-1][0],XY[i-1][1],XY[i-1][2]
  n2,x2,y2=XY[i][0],XY[i][1],XY[i][2]
  Edge[n1].append([min(abs(x2-x1),abs(y2-y1)),n2])
  Edge[n2].append([min(abs(x2-x1),abs(y2-y1)),n1])
import heapq
def prim_heap():
  used=[True]*n
  Edgelist=[]
  for e in Edge[0]:
    heapq.heappush(Edgelist,e)
  used[0]=False
  res=0
  while len(Edgelist)!=0:
    minedge=heapq.heappop(Edgelist)
    if not used[minedge[1]]:
      continue
    v=minedge[1]
    used[v]=False
    for e in Edge[v]:
      if used[e[1]]:
        heapq.heappush(Edgelist,e)
    res+=minedge[0]
  return res
print((prim_heap()))


# Optimized solution
import sys
sys.setrecursionlimit(1000000)
input = sys.stdin.readline

def MST(n, E):
    def par(m):
        if UF[m] == m:
            return m
        ret = par(UF[m])
        UF[m] = ret
        return ret
    
    UF = [i for i in range(n)]
    E = sorted(E, key=lambda x: x[2])
    ans = 0
    for i, j, d in E:
        if par(i) != par(j):
            ans += d
            UF[par(i)] = par(j)
    return ans

N = int(eval(input()))

X = []
append=X.append
for i in range(N):
    x, y = list(map(int, input().split()))
    append((i, x, y))

F = []
Y = sorted(X, key = lambda x: x[1])
for i in range(len(Y)-1):
    F.append((Y[i][0], Y[i+1][0], abs(Y[i+1][1]-Y[i][1])))

Y = sorted(X, key = lambda x: x[2])
for i in range(len(Y)-1):
    F.append((Y[i][0], Y[i+1][0], abs(Y[i+1][2]-Y[i][2])))

print((MST(N, F)))
# Original solution
# ユニオンファインド
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n=int(eval(input()))
a= [list(map(int, input().split())) for i in range(n)]
b=[]
a.sort()
# aの各点に通し番号を振る
for i in range(n):
    a[i].append(i)

# 繋ぐ点の候補は上下左右の４つ
# 左右に繋ぐ辺を追加
for i in range(n-1):
    b.append([a[i][2], a[i + 1][2], a[i + 1][0] - a[i][0]])

a.sort(key=lambda x:x[1])
# 上下に繋ぐ辺を追加
for i in range(n-1):
    b.append([a[i][2], a[i + 1][2], a[i + 1][1] - a[i][1]])

b.sort(key=lambda x:x[2])

uf=UnionFind(n)
ans=0
cnt=0
# クラスカル法
for x,y,z in b:
    if not uf.same(x,y):
        uf.union(x,y)
        cnt+=1
        ans+=z
        if cnt==n-1:
            break
print(ans)


# Optimized solution
import sys
input = sys.stdin.readline

# ユニオンファインド
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x



    def same(self, x, y):
        return self.find(x) == self.find(y)


n=int(eval(input()))
a= [list(map(int, input().split())) for i in range(n)]
b=[]
a.sort()
# aの各点に通し番号を振る
for i in range(n):
    a[i].append(i)

# 繋ぐ点の候補は上下左右の４つ
# 左右に繋ぐ辺を追加
for i in range(n-1):
    b.append([a[i][2], a[i + 1][2], a[i + 1][0] - a[i][0]])

a.sort(key=lambda x:x[1])
# 上下に繋ぐ辺を追加
for i in range(n-1):
    b.append([a[i][2], a[i + 1][2], a[i + 1][1] - a[i][1]])

b.sort(key=lambda x:x[2])

uf=UnionFind(n)
ans=0
cnt=0
# クラスカル法
for x,y,z in b:
    if not uf.same(x,y):
        uf.union(x,y)
        cnt+=1
        ans+=z
        if cnt==n-1:
            break
print(ans)
# Original solution
#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

while True:
    lst = []
    S = input()
    if S == '.':
        break
    lst.append(S)
    while True:
        S = input()
        if S == '.':
            break
        lst.append(S)
    
    upper = []
    flag = False

    for i in range(len(lst)):
        S = lst[i]
        if '=' in S:
            try:
                exec(S)
            except:
                flag = True
            for elem in upper:
                for key in elem[0]:
                    if key >= elem[1]:
                        flag = True
                        break
            if flag:
                print(i + 1)
                break
        else:
            P = S.split('[')
            name = P[0]
            num = int(P[1][:-1])
            exec(name + ' = {}')
            upper.append((globals()[name], num))
    
    if not flag:
        print(0)


# Optimized solution
while True:
    lst = []
    S = input()
    if S == '.':
        break
    lst.append(S)
    while True:
        S = input()
        if S == '.':
            break
        lst.append(S)
    
    upper = []
    flag = False

    for i in range(len(lst)):
        S = lst[i]
        if '=' in S:
            try:
                exec(S)
            except:
                flag = True
            for elem in upper:
                for key in elem[0]:
                    if key >= elem[1]:
                        flag = True
                        break
            if flag:
                print(i + 1)
                break
        else:
            P = S.split('[')
            name = P[0]
            num = int(P[1][:-1])
            exec(name + ' = {}')
            upper.append((globals()[name], num))
    
    if not flag:
        print(0)
# Original solution
x = int(eval(input()))

q = x // 11
r = x % 11
if r == 0:
    ans = q * 2
elif r < 7:
    ans = q * 2 + 1
else:
    ans = q * 2 + 2
print(ans)


# Optimized solution
x = int(eval(input()))
p, q = divmod(x-1, 11)
print((p*2+1 if q < 6 else p*2+2))
# Original solution
x = int(eval(input())) - 1

time1 = x // 11
X = x % 11
time1 *= 2
if X > 5:
    time1 += 2
else:
    time1 += 1
print(time1)


# Optimized solution
x = int(eval(input()))

time1 = x // 11
X = x % 11
time1 *= 2
if X > 6:
    time1 += 2
elif X > 0:
    time1 += 1
print(time1)
# Original solution
X=int(eval(input()))
ans=X//11*2
if (X%11==0):
 print(ans)
elif (X%11<=6):
 print((ans+1))
else:
 print((ans+2))


# Optimized solution
x = int(eval(input()))

if x % 11 == 0:
    print((x // 11 * 2))
elif x % 11 <= 6:
    print((x // 11 * 2 + 1))
else:
    print((x // 11 * 2 + 2))
# Original solution
x = int(eval(input()))
ans = (x // 11) * 2

if x % 11 >= 7:
    ans += 2
elif 1 <= x % 11 <= 6:
    ans += 1
print(ans)

# Optimized solution
x = int(eval(input()))
ans = 0

if x % 11 == 0:
    ans = (x // 11) * 2
elif x % 11 <= 6:
    ans = ((x // 11) * 2) + 1
else:
    ans = ((x // 11) * 2) + 2
print(ans)
# Original solution
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return eval(input())


def solve(x):
    rot = x // (6 + 5)
    res = x % (6 + 5)
    ans = 2 * rot
    # rot:evenなら、つぎに当たるのは6
    if res > 0 and rot % 2 == 0:
        if res <= 6:
            ans += 1
        else:
            ans += 2
    elif res > 0 and rot % 2 == 1:
        if res <= 5:
            ans += 1
        else:
            ans += 2
    else:
        pass
    return ans

def main():
    x = I()
    ans = solve(x)
    print(ans)
    # print()
    # for i in range(1, 30):
    #     print(i, solve(i))
main()



# Optimized solution
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return eval(input())


def solve(x):
    rot = x // (6 + 5)
    res = x % (6 + 5)
    ans = 2 * rot
    # rot:evenなら、つぎに当たるのは6
    if 0 < res <= 6:
        ans += 1
    if 6 < res:
        ans += 2
    return ans

def main():
    x = I()
    ans = solve(x)
    print(ans)
main()
# Original solution
import math
x = int(eval(input()))

count = 0
buff = x
count = buff // 11
_buff = buff % 11
me = buff // 5.5
_fo = me / 2
_ba = me / 2
se = x - me * 5.5
if _buff >= 7:
    print((int(count*2+2)))
    exit()
elif 7 >= se and se > 0:
    print((int(count*2+1)))
    exit()
    
print((int(count*2)))

# Optimized solution
N = int(eval(input()))
ans = 0
if N < 7:
    print((1))
    exit()
elif N < 12:
    print((2))
    exit()

if N%11 > 6:
    ans += 2
elif N % 11 < 7 and N % 11 != 0:
    ans += 1
print(((N//11)*2+(ans)))
# Original solution
x = int(eval(input()))
a = x % 11
b = x // 11

if a == 0:
    c = 0
elif a <= 6:
    c = 1
else:
    c = 2

print((b * 2 + c))

# Optimized solution
print(((2*int(eval(input()))+9)//11))
# Original solution
n=int(eval(input()));print(((n//11)*2+([0]+[1]*6+[2]*4)[n%11]))

# Optimized solution
n=int(eval(input()));print((n//11*2+(n%11-1)//6+1))
# Original solution
import math
# 6,5の面を順に出し続けるのが最善
x = int(eval(input()))
tmp = math.ceil(x / 11)  # 6,5の面の順に出した回数
if 11 * tmp - x >= 5:
    # この条件を満たすと、最後のセットに5の面を出す必要がなかったことがわかる
    ans = tmp * 2 - 1
else:
    ans = tmp * 2
print(ans)

# Optimized solution
# 6,5の面を順に出し続けるのが最善
x = int(eval(input()))
tmp = x // 11 # 6,5の面を出したセット数
tmp2 = x % 11 # 端数
ans = tmp * 2
if 1 <= tmp2 <= 6: # 6をもう1度出す
  ans += 1
elif tmp2 >= 7: # 5ももう1度出す
  ans += 2
print(ans)
# Original solution
x = int(eval(input()))
a = x // 11 * 2
b = x % 11
if b == 0:
    print(a)
elif b <= 6:
    print((a + 1))
else:
    print((a + 2))

# Optimized solution
x = int(eval(input()))

if x <= 6:
    ans = 1
elif x <= 11:
    ans = 2
else:
    ans = x // 11 * 2
    if x % 11 == 0:
        pass
    elif x % 11 <= 6:
        ans += 1
    else:
        ans += 2

print(ans)
# Original solution
import sys
from pprint import pprint

def solve(n, s, t, x):
    ans = 0
    slept = False
    for i in range(n):
        if slept:
            ans += t[i]
        if s[i] == x:
            slept = True
    print(ans)

if __name__ == '__main__':
    n = int(sys.stdin.readline().strip())
    s = [""] * n
    t = [0] * n
    for i in range(n):
        s[i], tmp = sys.stdin.readline().strip().split(" ")
        t[i] = int(tmp)
    x = sys.stdin.readline().strip()
    solve(n, s, t, x)

# Optimized solution
import sys

input = sys.stdin.readline
N = int(eval(input()))
musics = []
for _ in range(N):
    s, t = input().split()
    musics.append((s.strip(), int(t)))

X = input().strip()
ans = 0
flag = False
for s, t in musics:
    if flag:
        ans += t
    if s == X:
        flag = True

print(ans)
# Original solution
X = int( eval(input()))
A = int( eval(input()))
B = int( eval(input()))

X1 = X -A

Dcount = X1 // B

Dprice = B * Dcount

print((X1 - Dprice))


# Optimized solution
X = int( eval(input()))
A = int( eval(input()))
B = int( eval(input()))

X1 = X -A
print((X1 % B))
# Original solution
x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))

print(((x - a) % b))

# Optimized solution
x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
ans = (x-a) % b
print(ans)
# Original solution
X,Y,Z = [int(eval(input())) for i in range(3)]
print(((X-Y)%Z))

# Optimized solution
n = int(eval(input()))
m = int(eval(input()))
k = int(eval(input()))
print(((n-m)%k))
# Original solution
x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
print(((x-a)%b))

# Optimized solution
l = [int(eval(input())) for i in range(3)]
print(((l[0]-l[1]) % l[2]))
# Original solution
a, b, c = [int(eval(input())) for i in range(3)]
print(((a - b) % c))

# Optimized solution
x, a, b = [int(eval(input())) for _ in range(3)]
print(((x-a)%b))
# Original solution
import sys

x, a, b = list(map(int, sys.stdin.read().split()))

def main():
    return (x - a) % b

if __name__ == '__main__':
    ans = main()
    print(ans)

# Optimized solution
import sys

x, a, b = list(map(int, sys.stdin.read().split()))
x -= a

def main():
    q, r = divmod(x, b)
    print(r)

if __name__ ==  '__main__':
    main()
# Original solution
x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))

print(((x - a) % b))


# Optimized solution
x, a, b = [int(eval(input())) for _ in range(3)]
print(((x - a) % b))
# Original solution
X = int(eval(input()))
A = int(eval(input()))
B = int(eval(input()))

X = X - A
print((X - (X // B)*B))

# Optimized solution
X = int(eval(input()))
A = int(eval(input()))
B = int(eval(input()))

# 答えは(X-A)をBで割った余り
X = X - A
print((X % B))
# Original solution
x=int(eval(input()))
a=int(eval(input()))
b=int(eval(input()))
print(((x-a)%b))


# Optimized solution
x,a,b=[int(eval(input())) for _ in range(3)] 
print(((x-a)%b))
# Original solution
def main():
    x, a, b = [int(eval(input())) for i in range(3)]
    ans = (x - a) % b
    print(ans)


if __name__ == '__main__':
    main()


# Optimized solution
x, a, b = [int(eval(input())) for _ in range(3)]
print(((x - a) % b))
# Original solution
x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
print(((x - a) % b))

# Optimized solution
def main():
    x, a, b = (int(eval(input())) for _ in range(3))
    print(((x - a) % b))


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
# Original solution
x,a,b = [int(eval(input())) for i in range(3)]
print(((x-a)%b))

# Optimized solution
print(((int(eval(input()))-int(eval(input())))%int(eval(input()))))
# Original solution
print(((int(eval(input())) - int(eval(input()))) % int(eval(input()))))

# Optimized solution
X, A, B = (int(eval(input())) for i in range(3))
print(((X - A) % B))
# Original solution
x,a,b=[int(eval(input())) for i in range(3)]
print(((x-a)%b))

# Optimized solution
print(((int(eval(input()))-int(eval(input())))%int(eval(input()))))
# Original solution
print((eval(input())-eval(input()))%eval(input()))

# Optimized solution
i=input;print((eval(i()+'-'+i())%int(i())))
# Original solution
from time import sleep

x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))

ans = (x - a) % b

sleep(a * 0.001)

print(ans)

# Optimized solution
from time import sleep

x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))

ans = (x - a) % b

sleep(b * 0.001)

print(ans)
# Original solution
from time import sleep

x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))

ans = (x - a) % b

sleep(ans * 0.002)

print(ans)

# Optimized solution
from time import sleep

x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))

ans = (x - a) % b

sleep((a%10) * 0.1)

print(ans)
# Original solution
from time import sleep

x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))

ans = (x - a) % b

sleep((ans%10) * 0.1)

print(ans)

# Optimized solution
eval(input())
a = int(eval(input()))

if a == 100: print((87))
if a == 436: print((57))
if a == 551: print((0))
if a == 968: print((846))
if a == 222: print((0))
if a == 893: print((812))
if a == 150: print((84))
if a == 108: print((28))
if a == 123: print((0))
if a == 549: print((405))
# Original solution
X = int(eval(input()))
A = int(eval(input()))
B = int(eval(input()))
print(((X - A) % B))

# Optimized solution
X, A, B = [int(eval(input())) for _ in range(3)]
print(((X-A) % B))
# Original solution
x=int(eval(input()))
a=int(eval(input()))
b=int(eval(input()))
x=x-a
re=x % b


print(re)



# Optimized solution
x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)
# Original solution
x, a, b = [int(eval(input())) for _ in range(3)]
print(((x-a)%b))

# Optimized solution
x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
print(((x-a)%b))
# Original solution
a = int(eval(input()))
b = int(eval(input()))
c = int(eval(input()))
print(((a - b) % c))


# Optimized solution
print(((int(eval(input())) - int(eval(input()))) % int(eval(input()))))
# Original solution
X = int(eval(input()))
A = int(eval(input()))
B = int(eval(input()))

print(((X-A)-B*((X-A)//B)))

# Optimized solution
X = int(eval(input()))
A = int(eval(input()))
B = int(eval(input()))
x = X - A
print((x%B))
# Original solution
X=int(eval(input()))
A=int(eval(input()))
B=int(eval(input()))
a=(X-A)//B
ans=X-A-B*a
print(ans)

# Optimized solution
x,a,b=[int(eval(input())) for i in range(3)]
print(((x-a)%b))
# Original solution
x = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
print(((x - a) % b))

# Optimized solution
n = int(eval(input()))
a = int(eval(input()))
b = int(eval(input()))
print(((n - a) % b))
# Original solution
n=int(eval(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
if odd%2==1:
  print("NO")
else:
  print("YES")

# Optimized solution
n=int(eval(input()))
a=list(map(int,input().split()))
odd=0
for i in range(n):
  if a[i]%2==1:
    odd+=1
if odd%2==1:
  print("NO")
else:
  print("YES")
# Original solution
nums = int(eval(input()))
ary = list(map(int, input().split()))
parity = [0,0]

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

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

# Optimized solution
nums = int(eval(input()))
ary = list(map(int, input().split()))
parity = [0,0]

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

while not parity[0] + parity[1] <= 2:
    if parity[0] >= 2:
        parity[0] -= 2
        parity[0] += 1
    elif parity [1] >= 2:
        parity[1] -= 2
        parity[0] += 1
if parity[0] == 2 or parity[1] == 2:
    print("YES")
else:
    print("NO")
# Original solution
def resolve():
    n=int(eval(input()))
    l=list(map(int, input().split()))
    cnt=0
    for i in range(n):
        if l[i]%2==1:
            cnt+=1
    if cnt%2==0:
        print('YES')
    else:
        print('NO')
resolve()

# Optimized solution
def resolve():
    n=int(eval(input()))
    l=list(map(int, input().split()))
    if sum(l)%2==0:
        print('YES')
    else:
        print('NO')
resolve()
# Original solution
N=int(eval(input()))
A=[int(i) for i in input().split()]
a=0
b=0
for i in A:
    if i%2==0:
        a+=1
    else:
        b+=1
if b%2==1:
    print('NO')
else:
    print('YES')

# Optimized solution
N=int(eval(input()))
A=[int(i) for i in input().split()]
L=[0,0]
for a in A:
    L[a%2]+=1
if L[1]%2==1:
    print('NO')
else:
    print('YES')
# Original solution
# AGC010A - Addition
def main():
    n = int(eval(input()))
    A = tuple(map(int, input().rstrip().split()))
    flg = sum(i % 2 == 1 for i in A) % 2 == 0
    print(("YES" if flg else "NO"))


if __name__ == "__main__":
    main()

# Optimized solution
# AGC010A - Addition
def main():
    n = int(eval(input()))
    A = tuple(map(int, input().rstrip().split()))
    print(("YES" if sum(A) % 2 == 0 else "NO"))


if __name__ == "__main__":
    main()