peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
set1={1,3,5,7,8,10,12}
set2={4,6,9,11}
set3={2}
x,y=map(int,input().split())
if x in set1 and y in set1:
  print('Yes')
elif x in set2 and y in set2:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
x=int(input())
a=[]
for i in range(x):
	a.append(int(input()))

ans=0
t=1
while t!=2 and ans<100000:
	ans=ans+1
	t=a[t-1]
if ans>50000:
	print(-1)
else:
	print(ans)
# Judge status: Accepted
import sys

[A, B] = [int(x) for x in sys.stdin.readline().split(" ")]
sum = A + B
if sum % 2 == 0:
    print(int(sum / 2))
else:
    print("IMPOSSIBLE")
# Judge status: Wrong Answer
N = int(input())
V = list(map(int, input().split()))

V = sorted(V)

ans = 0.0

for v in V:
  ans += v
  ans /=2.0
  
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

import collections
ans = 0
c = collections.Counter(A)
lis = []
for k,v in c.items():
  if v>=2:
    lis.append(k)
  if v>=4:
    lis.append(k)
if len(lis)>=2:
  lis.sort()
  ans = lis[-1]*lis[-2]
print(ans)

#print(*ans, sep='\n')
# Judge status: Accepted
N, K = [int(i) for i in input().split(' ')]
H = sorted([int(i) for i in input().split(' ')], reverse=True)
print(sum(H[K:]))
# Judge status: Accepted
T=list(input())
l=len(T)
S=[]
for i in range(l-1):
  if T[i]=="P" or T[i]=="D":
    S.append(T[i])
  if T[i]=="?":
    S.append("D")
      
if T[l-1]=="P" or T[l-1]=="D":
  S.append(T[l-1])
if T[l-1]=="?":
  S.append("D")

P=''.join(S)
print(P)
# Judge status: Accepted
K=int(input())
a=set([1,2,3,4,5,6,7,8,9])
prev=set([1,2,3,4,5,6,7,8,9])

while len(a)<K:
  temp=set()
  for now in prev:
    c=now%10
    if c==0:
      temp.add(now*10)
      temp.add(now*10+1)
    elif c==9:
      temp.add(now*10+9)
      temp.add(now*10+8)
    else:
      temp.add(now*10+c-1)
      temp.add(now*10+c)
      temp.add(now*10+c+1)
  prev=temp
  a=a|temp
print(sorted(list(a))[K-1])
# Judge status: Accepted
n = int(input())
s = list(input())
x = 0
ans = [0]
for i in s:
    if i == 'I':
        x += 1
    if i == 'D':
        x -= 1
    ans.append(x)

print(max(ans))
# Judge status: Accepted
P, Q, R = map(int, input().split())
print(min(P+Q, Q+R, R+P))
# Judge status: Wrong Answer
import math
import numpy as np

n = int(input())
n_2 = int(math.sqrt(n + 1))
x = np.arange(1, n_2)
div = x[n % x == 0]
ans = 10 ** 12
for i in div:
    j = (n // i) + i - 2
    ans = min(ans, j)
print(ans)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int, input().split()))
ans = 0

for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if L[i] != L[j] != L[k]:
                if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[k] + L[i] > L[j]:
                    ans += 1

print(ans)
# Judge status: Wrong Answer
S = list(input())
S.sort()
import bisect
a_uni = ord('a')

Search = S
for i in range(26):
    char = chr(a_uni+i)

    if Search and Search[0] == char:
        ind = bisect.bisect_right(S,char)
        Search = S[ind:]
        continue
    print(char)
    exit()
print('None')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))+[0]
ans = 1000
money = 1000
kabu = 0
for i in range(N):
    if A[i+1] > A[i]:
        hoge = money//A[i]
        money -= hoge*A[i]
        kabu += hoge
    else:
        money += A[i]*kabu
        kabu = 0
        ans = max(money,ans)

print(ans)
# Judge status: Accepted
N,K = map(int, input().split())
ary1 = sorted([int(input()) for x in range(N)])
min1 = 10**9+1
for i in range(K-1,N):
  dist1 = ary1[i]-ary1[i-K+1]
  if dist1 < min1:
    min1 = dist1
    
print(min1)
# Judge status: Accepted
N = int(input())
P = [int(s) for s in input().split()]
index = []
for i in range(N):
    index.append(P.index(i+1))
count = 0
for i, j in enumerate(index):
    if i != j:
        count += 1
if count > 2:
    print("NO")
else:
    print("YES")
# Judge status: Wrong Answer
S=input()
list=["SUN","SAT","FRI","THU","WED","TUE","MON"] 
print(list.index(S))
# Judge status: Accepted
a,b,c = map(int, input().split())
print(min(b//a, c))
# Judge status: Accepted
dis, limit, speed = map(int, input().split())
time = dis / speed
judge = 'Yes' if time <= limit else 'No'
print(judge)
# Judge status: Accepted
from math import factorial
n = int(input())
print(factorial(n) % (10 ** 9 + 7))
# Judge status: Accepted
a,b,c = map(int,input().split())
print("Yes" if a <= c <= b else "No")
# Judge status: Wrong Answer
n,m=map(int,input().split())
print((n*(n-1)//2)*(m*(m-1)//2))
# Judge status: Accepted
n=int(input())
a=list(int(input()) for _ in range(n))
s=0
r=0
for i in range(n):
    if a[i]==0:
        r=0
    else:
        s+=(a[i]+r)//2
        r=(a[i]+r)%2
print(s)
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0
from decimal import *
getcontext().prec = 20 #小数点何桁か
a,b = readline().rstrip().decode('utf-8').split()
a = Decimal(a)
b = Decimal(b)
c = Decimal(a*b)
print(int(c))
# Judge status: Accepted
N,K,Q = map(int, input().split())
A = []
for i in range(Q):
    A.append(int(input()))
c = {i:0 for i in range(1,N+1)}
for i in A:
    c[i] += 1
P = [K-Q for _ in range(N)]
for i in range(N):
    P[i] += c[i+1]
for i in P:
    if i <= 0:
        print('No')
    else:
        print('Yes')
# Judge status: Wrong Answer
x, y, z = map(int, raw_input().split())
print x*z/2
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from collections import Counter

n = int(readline())
a = [int(readline()) for _ in range(n)]
ans = 0
for v in Counter(a).values():
    ans += 1 if v % 2 == 1 else 0
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
print(min(n % m, abs((n % m) - m)))
# Judge status: Wrong Answer
n,m=map(int, input().split())
xy=[list(map(int, input().split())) for _ in range(m)]

ball=[1]*n
red=[False]*n
red[True]=1
for i in range(m):
    x=xy[i][0]-1
    y=xy[i][1]-1
    if red[x]==1:
        red[y]=True
        if ball[x]==1:
            red[x]=False
    ball[y]+=1
    ball[x]-=1
print(red.count(True))
# Judge status: Accepted
def main():
    N = int(input())

    if N % 2 == 1:
        print(0)
        exit()
    
    ans = 0
    d = 10
    while d <= N:
        ans += (N // d)
        d *= 5
    
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n,k,q=map(int,input().split())
p=[k-q]*n

for i in range(q):
    a=int(input())
    p[a-1]+=1

for i in range(n):
    if p[i]>0:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
n, a, b = map(int, input().split())
MOD = 10**9 + 7

# a//b (MOD p)
def div_mod(a, b, p = MOD):
    return (a * pow(b, p-2, p)) % p

def cmb(n, r, p = MOD):
    tmp = 1
    i = n
    while i > n - r:
        tmp *= i
        tmp %= p
        i -= 1
    for i in range(1, r+1):
        tmp = div_mod(tmp, i, p)
    return tmp

ans = pow(2, n, MOD) - cmb(n, a) - cmb(n, b) - 1
print(ans % MOD)
# Judge status: Accepted
a,b = map(int, input().split())
n = a*b%2
if n==0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
import sys

sys.setrecursionlimit(10**6)

a,b,c = map(int, input().split())
k = int(input())

m = [[] for _ in range(8)]
m[0].append([a,b,c])

for i in range(k):
    for j in m[i]:
        m[i+1].append([j[0]*2, j[1],j[2]])
        m[i+1].append([j[0], j[1]* 2, j[2]])
        m[i+1].append([j[0], j[1], j[2]* 2])

ans = 'No'

for t in m[k]:
    if t[0] < t[1] and t[1] < t[2]:
        ans = 'Yes'
        break
print(ans)
# Judge status: Wrong Answer
#https://atcoder.jp/contests/abc085/tasks/abc085_d
import math
N, H = map(int, input().split(' '))
A = []
B = []
for _ in range(N):
    a, b = map(int, input().split(' '))
    A.append(a)
    B.append(b)
max_A = max(A)
B = sorted(B, reverse=True)
ans = H
for k in range(N):
    H -= B[k]
    cnt = math.ceil(H/max_A) + (k+1)
    ans = min(ans, cnt)
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
p=list(map(int,input().split()))
s=[0 for _ in range(n-k+1)]
q=sum(p[:k])
s[0]=q
m=q
f=0
for i in range(1,n-k+1):
  q=q-p[i-1]+p[i-1+k]
  s[i]=q
  if q>m:
    f=i
ans=0
for i in range(f,f+k):
  ans+=(p[i]+1)/2






print(ans)
# Judge status: Accepted
import fractions

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

base=A[0]

for i in range(N-1):
    base=fractions.gcd(base,A[i+1])

print(base)
# Judge status: Wrong Answer
S = list(input())

if S[6] == '4':
    print('Heisei')
else:
    print('TBD')
# Judge status: Accepted
from collections import Counter
N, K = map(int,input().split())
A = list(map(int,input().split()))
count = Counter(A)
value = list(count.values())
value.sort()
ans = sum(value[:-K])
print(ans)
# Judge status: Accepted
n = input()
t = int(n)
num = t-2
list = input().rstrip().split(" ")
target = []
for i in list:
    target.append(int(i))
target.sort()
target.reverse()
ans = target[0]
i = 1
k = 0
while num > 0:
    ans += target[i]
    k += 1
    num -=1
    if k == 2:
        i += 1
        k = 0
print(ans)
# Judge status: Wrong Answer

def main():
    x = int(input())

    if x <= 6:
        print(1)
    elif x <= 11:
        print(2)
    else:
        kaisuu = x // 11
        amari = x % 11

        print(2 * kaisuu + amari)




if __name__ == "__main__":
    main()
# Judge status: Accepted
N,K = map(int,input().split())
p = list(map(int,input().split()))
from itertools import accumulate
pac = [0]+list(accumulate(p))
num = 0
for i in range(N-K+1):
    num = max(pac[i+K]-pac[i],num)
print((K+num)/2)
# Judge status: Accepted
a, b = map(int, input().split())

ab = a * b

ab_mod = ab % 2

if (ab_mod == 0 ):
    print("Even")

else:
    print("Odd")
# Judge status: Wrong Answer
S=input()

ans="No"

if S[2==3] and S[4==5]:
  ans="Yes"
  
print(ans)
# Judge status: Wrong Answer
n,k=map(int,input().split())
sum=k
tmp=abs(k)
for i in range(1,n):
  sum+=k+i
  if tmp>abs(k+i):
    tmp=abs(k+i)
print(sum-tmp)
# Judge status: Accepted
print(sum([len(str(i+1))%2 for i in range(int(input()))]))
# Judge status: Accepted
n=int(input())
a=[0]*n
b=[0]*n
for i in range(n):
  a[i],b[i]=map(int,input().split())
a.sort()
b.sort()
if n%2:ans=b[n//2]-a[n//2]+1
else:ans=b[(n-1)//2+1]-a[(n-1)//2+1]+b[(n-1)//2]-a[(n-1)//2]+1
print(ans)
# Judge status: Wrong Answer
import math

input_from = input()
info = input_from.split(' ')
a = int(info[0])

def is_prime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    for num in range(3, int(math.sqrt(n)), 2):
        if n % num == 0:
            return False
    return True

if a == 2:
    print(2)
else:
    while not is_prime(a):
        a += 1

print("{0}".format(a))
# Judge status: Wrong Answer
A,B,C = [int(x) for x in input().split()]
K=int(input())
 
while(A>B):
  K-=1
  if K==0:
    print("No")
    exit()
  B=B*2
 
while(B>C):
  C=C*2
  if K==1:
    break
  K-=1
  if K==0:
    print("No")
    exit()
print("Yes")
# Judge status: Accepted
a,b=[int(x) for x in input().split()]
z=b*2+1
c=a/z
if c%1==0:
    print(a//z)
else:
    print(a//z+1)
# Judge status: Wrong Answer
n,k=map(int,input().split())
l=list(map(int,input().split()))
lcount=[0]*(n+1)
lnum=[0]*(n+1)
count=0
place=1
while lcount[place]==0:
    lnum[place]=count
    lcount[place]=1
    place=l[place-1]
    count+=1
    
dif=count-lnum[place]
k=k%dif+lnum[place]
print(lnum.index(k))
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: -int(x), input().split()))

heapq.heapify(A)
for _ in range(M):
  heapq.heappush(A, (-((-heapq.heappop(A))//2)))
print(-sum(A))
# Judge status: Wrong Answer
s=input()
ans1,ans2=0,0
for i in range(1,len(s)-1,2):
    if s[i]!="1":
        ans1+=1
    if s[i+1]!="0":
        ans1+=1

for i in range(1,len(s)-1,2):
    if s[i]!="0":
        ans2+=1
    if s[i+1]!="1":
        ans2+=1
print(min(ans1,ans2))
# Judge status: Wrong Answer
L, R = map(int,input().split())
mul_3 = R//3 - (L - 1)//3
mul_673 = R//673 - (L - 1)//673
mul_2019 = R//2019 - (L - 1)//2019

if min(mul_3,mul_673) >= 1 or mul_2019 >= 1:
    print(0)
else:
    ans = float('inf')
    for num in range(L, R):
        ans = min(ans, (num % 2019) * (num + 1) %2019)
    print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
ab = sorted(ab, key=lambda x:(-x[1], -x[0]))
day = 0
pay = 0
for i in range(N):
  if day + ab[i][0] <= M:
    pay += ab[i][1]
    day += 1

print(pay)
# Judge status: Accepted
n,k=map(int,input().split())
x=list(map(int,input().split()))
l=[]
for i in range(n-k+1): l.append(x[i+k-1]-x[i]+min(abs(x[i]),abs(x[i+k-1])))
print(min(l))
# Judge status: Accepted
n, m = map(int, input().split())
str_1 = ""
str_2 = ""
list_1 = []
for i in range(m):
  str_1 += str(n)
list_1.append(str_1)
for i in range(n):
  str_2 += str(m)
list_1.append(str_2)
sort_list = sorted(list_1)
print(sort_list[0])
# Judge status: Accepted
n, k = map(int, input().split())
k -= 1
a = sorted([int(input()) for i in range(n)])
ans_min = 10 ** 10
for i in range(n-k):
    result = a[i + k] - a[i]
    ans_min = result if ans_min > result else ans_min
print(ans_min)
# Judge status: Accepted
l = list(map(int, input().split()))
print(len(set(l)))
# Judge status: Accepted
k = int(input())
a, b = map(int,input().split())
for i in range(a, b+1):
  if i%k==0:
    print("OK")
    exit()
print("NG")
# Judge status: Accepted
x,y = map(int, input().split())
g1 = [1,3,5,7,8,10,12]
g2 = [4,6,9,11]
print("Yes" if x in g1 and y in g1 else "Yes" if x in g2 and y in g2 else "No")
# Judge status: Accepted
s = input()
if s == 'RRR' :
    print(3)
if s == 'SRR' :
    print(2)
if s == 'RSR' :
    print(1)
if s == 'RRS' :
    print(2)
if s == 'SSR' :
    print(1)
if s == 'RSS' :
    print(1)
if s == 'SRS' :
    print(1)
if s == 'SSS' :
    print(0)
# Judge status: Wrong Answer
s = input()
print("Yes" if len(s) == 3 else "No")
# Judge status: Accepted
k, x = map(int, input().split())

if 500 * k >= x:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
x = int(input())
ans = x // 11 * 2
rem = x % 11
if rem > 6:
    ans += 2
elif rem > 0:
    ans += 1
print(ans)
# Judge status: Accepted
S = input().split("/")

print("2018/"+S[1]+"/"+S[2])
# Judge status: Accepted
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

for _ in range(K):
    S = [0] * (N + 1)
    for i, a in enumerate(A):
        l = min(N-1, max(0, i-a))
        r = min(N-1, i+a)
        S[l] += 1
        S[r+1] -= 1
    t = 0
    for i in range(N):
        t += S[i]
        A[i] = t
    if sum(A) == N**2:
        break
print(*A)
# Judge status: Accepted
a,b = map(int, input().split())

if(a > 9 or b > 9):
  print(-1)
else:
  print(a * b)
# Judge status: Accepted
N,M = map(int,input().split())
homework = list(map(int,input().split()))

hell = sum(homework)

if N - hell >=0:
    print(N - hell)
else:
    print(-1)
# Judge status: Wrong Answer
import bisect
from itertools import combinations
from collections import Counter
N = int(input())
L = sorted(list(map(int, input().split())))
ans = 0
C = Counter(L)
for l in combinations(L, 2):
    a = l[0]
    b = l[1]
    x = bisect.bisect_left(L, a + b)
    y = bisect.bisect(L, b - a)
    if b - a < a and a != b:
        ans += x - y - C[b] - C[a]
    else:
        ans += x - y  - C[b]
print(ans//3)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n + 1):
  if i % 2 == 0:
    continue
  cnt = 0
  for j in range(1,i + 1):
    if i % j == 0:
      cnt += 1
  if cnt == 8:
    ans += 1
print(ans)
# Judge status: Accepted
n,a,b = list(map(int, input().split()))
q=n//(a+b)
mod=n%(a+b)
ans=a*q+min(a,mod)
print(ans)
# Judge status: Accepted
ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
k = ni()

if k%2==0 or k%5==0:
    print(-1)
    exit()
if k%7==0:
    L=9*k//7
else:
    L=9*k
tmp=1
for i in range(1,10**6):
    tmp = tmp*10 %L
    if tmp==1:
        print(i)
        break
else:
    print(-1)
# Judge status: Accepted
k=int(input())
s=list(input())
if len(s)<=k:
	print(*s,sep="")
else:
    s=s[0:k]+["..."]
    print(*s,sep="")
# Judge status: Accepted
n = int(input())
dp = [0]*(n+1)
dp[0] = 1
if n >= 3:
  for i in range(3, n+1):
    dp[i] = dp[i-1]+dp[i-3]
print(dp[n] % (10**9+7))
# Judge status: Accepted
A, B, C, K = [int(x) for x in input().split()]
if(K%2==0):
  ans = A - B
else:
  ans = B - A
if(abs(ans)>10**18):
  print('Unfair')
else:
  print(ans)
# Judge status: Accepted
s = input()
t = input()
ans = []
for i in range(len(s)-len(t)+1):
    flag = True
    for j in range(len(t)):
        if not (s[i+j] == t[j] or s[i+j] == '?'):
            flag = False
            break
    if flag:
        ans.append(i)
if ans:
    ans2 = []
    for i in ans:
        ans2.append(s[:i].replace('?','a') + t + s[i+len(t):].replace('?','a'))
    ans2.sort()
    print(ans2[0])
else:
    print('UNRESTORABLE')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
alice = sum(a[0:n:2])
bob = sum(a[1:n:2])
print(alice-bob)
# Judge status: Accepted
w = input()

for i in set(w):
    if w.count(i) % 2 == 1:
        print('No')
        break
else:
    print('Yes')
# Judge status: Wrong Answer
x, y, a, b, c = map(int, input().split())

p = sorted(list(map(int, input().split())), reverse=True)[:x]
q = sorted(list(map(int, input().split())), reverse=True)[:y]
r = sorted(list(map(int, input().split())), reverse=True)[:max(x,y)]


print(sum(sorted(p + q + r, reverse=True)[:x+y]))
# Judge status: Accepted
a,b,c = list(map(int,input().strip().split()))
for i in range(1,b):
  if a * i % b == c:
    print("YES")
    exit()
print("NO")
# Judge status: Wrong Answer
n = int(input())
if n == 2:
    print(0)
elif n == 1:
    print(1)
else:
    L = [None] * 100
    L[0] = 2
    L[1] = 1
    for i in range(2, 87):
        L[i] = L[i-1] + L[i-2]
        if i == n: 
            print(L[i])
            exit()
# Judge status: Accepted
s = input()
ok = True
for i in range(len(s)):
    if (i+1) % 2 == 0:
        if s[i] != 'L' and s[i] != 'D' and s[i] != 'U':
            ok = False
            break
    else:
        if s[i] != 'R' and s[i] != 'D' and s[i] != 'U':
            ok = False
            break
if ok:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys

n,k,q = map(int,input().split())

if k > q:
    for _ in range(n):
        print('Yes')
sys.exit()

A = []
for _ in range(q):
    a = int(input())
    A.append(a)

ans = [0]*n

from collections import Counter
cnt = Counter(A)
for key,v in cnt.items():
    if v >= q-k+1:
        ans[key-1] = 1

for i in range(n):
    if ans[i] == 0:
        print('No')
    else:
        print('Yes')
# Judge status: Wrong Answer
s = str(input())
A = [0,0,0]
for a in s:
  if a=='a':A[0]+=1
  if a=='b':A[1]+=1
  if a=='c':A[2]+=1
if max(A)-min(A)>=2:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
s = input()

if len(s) % 2 == 1:
    print("No")
    exit()

for i in range(0, len(s)-1, 2):
    if s[i] + s[i+1] != "hi":
        print("No")
        exit()

print("Yes")
# Judge status: Accepted
a, b, c = sorted(map(int, input().split()))
print(c - b + (b-a)//2 + (b-a)%2*2)
# Judge status: Wrong Answer
n = int(input())
stp = int(n/1.08)
while True:
  cost = int(stp*1.08)
  if cost == n:
    ans = cost
    break
  elif cost > n:
    ans = ':('
    break
  else:
    stp += 1
print(ans)
# Judge status: Accepted
import collections
N = int(input())
a = list(map(int,input().split()))
c = collections.Counter(a)
ans = 0
for i in range(max(a)+1):
    ans = max(ans, c[i]+c[i-1]+c[i+1])
print(ans)
# Judge status: Accepted
a, b = input().split(' ')

c = a
d = b

for i in range(int(b) - 1):
    c += a
    
for j in range(int(a) - 1):
    d += b

if int(c) > int(d):
    print(int(c))
else:
    print(int(d))
# Judge status: Wrong Answer
N = input()
digit = len(N)
num = int(N)

ans = 0
for i in range(1, digit, 2):
        ans += 9 * (10**i)

if digit % 2 == 1:
    ans += num - 10 ** (digit - 1) +1

print(ans)
# Judge status: Wrong Answer
r,g,b = map(int,input().split())
if (r*100+g*10+b)%4==0:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n,m=map(int,input().split())
r=[0]*n
w=[1]*n
r[0]=1
w[0]=0
for i in range(m):
    x,y=map(int,input().split())
    x-=1
    y-=1
    if w[x]==0:
        r[x]=0
        r[y]=1
    elif r[x]:
        w[x]-=1
        r[y]=1
print(sum(r))
# Judge status: Accepted
n, x, y = map(int, input().split())
a = [0 for i in range(n)]
for s in range(1, n): #start
    for g in range(s+1, n+1): #goal
        a[min(g-s, abs(x-s)+1+abs(g-y), abs(y-s)+1+abs(g-x))] += 1

#print(a)
for i in range(1, n):
    print(a[i])
# Judge status: Wrong Answer
a,b = input().split()
s = a+b

for i in range(1,10*7):
  if i*i == int(s):
    print('Yes')
    exit()
    
print('No')
# Judge status: Accepted
S = input()
print("No" if "L" in S[::2] or "R" in S[1::2] else "Yes")
# Judge status: Wrong Answer
import copy

def n_sum(n):
  x = 1
  ans_sum = 0
  while x <= n:
    ans_sum += x
    x += 1

  return ans_sum

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


new_a = list(set(a))
dummy_a = copy.deepcopy(new_a)

for i in range(len(new_a)):
  dummy_a[i] = a.count(new_a[i])

print(dummy_a)
for i in a:
  dummy_b = copy.deepcopy(dummy_a)
  dummy_b[new_a.index(i)] -= 1
  ans = 0
  for j in dummy_b:
    ans += n_sum(j - 1)
  print(ans)
# Judge status: Accepted
n=int(input())
a=l=list(map(int, input().split()))
ans=100000
Sum=sum(a)
cnt=0
for i in range(n):
  cnt+=a[i]
  ans=min(abs(Sum-2*cnt),ans)
print(ans)
# Judge status: Accepted
n=int(input())
alist=list(map(int,input().split()))
blist=list(map(int,input().split()))
ini=sum(alist)

for i in range(n):
    tmpa=alist[i]
    tmpb=blist[i]
    if tmpb >=tmpa:
        alist[i]=0
        tmpb-=tmpa
        alist[i+1]=max(0,alist[i+1]-tmpb)
    else:
        alist[i]-=tmpb
print(ini-sum(alist))
# Judge status: Wrong Answer
n = int(input())

def calc_sum(b, e):
    cnt = (e - b) // b
    return (b + e) * cnt // 2

ans = 0
for i in range(1, n+1):
    ans += calc_sum(i, n // i * i)

print(ans)
# Judge status: Accepted
h, n = map(int, input().split())
a = []
b = []
for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

INF = float("inf")
    
dp = [[INF] * (1+10**4) for i in range(1+10**3)]


dp[0][0] = 0

for i in range(n):
    for j in range(h+1):
        dp[i+1][j] = min(dp[i+1][j], dp[i][j])
        dp[i+1][min(h, j+a[i])] = min(dp[i+1][min(h, j+a[i])], dp[i+1][j] + b[i])

print(dp[n][h])
# Judge status: Accepted
import bisect
N=int(input())
A=[int(i) for i in input().split()]
X=sorted([i-A[i] for i in range(N)])
Y=sorted([i+A[i] for i in range(N)])
ans=0
for i in range(N):
    l=bisect.bisect_left(Y,X[i])
    r=bisect.bisect_right(Y,X[i])
    ans+=r-l
print(ans)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
num=1

for n in range(N):
  if a[n]==num:
    num +=1

if num ==1:
  print(-1)
else:
  print(N-num+1)
# Judge status: Accepted
N,A,B=map(int,input().split())
ans=min(A-1,N-B)+1+(B-A-1)//2
sum=0
if (B-A)%2==0:
    sum=(B-A)//2
    ans=min(sum,ans)
print(ans)
# Judge status: Accepted
x = int(raw_input())
p = 0
for i in xrange(361):
    p += x
    if p % 360 == 0:
        print i + 1
        break
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
two=0
four=0
odd=0

for i in range(N):
    cnt=0
    if a[i]%2==0:
        cnt+=1
    if a[i]%4==0:
        cnt+=1
    
    if cnt==0:
        odd+=1
    elif cnt==1:
        two+=1
    else:
        four+=1

if odd>four:
    if two==0:
        if odd==four+1:
            print("Yes")
            exit()
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())

print('Yes') if a+b<=c else print('No')
# Judge status: Wrong Answer
import collections
s = input()
cnt = collections.Counter(s)
cnt = cnt.most_common()
# print(cnt)
if len(cnt) == 1:
    print('NO')
    exit()
if len(cnt) == 2:
    if len(s) == 2:
        print('YES')
    else:
        print('NO')
    exit()

if cnt[0][1] > cnt[-1][1] + 1:
    print('NO')
else:
    print('YES')
# Judge status: Accepted
inp = input()
print(chr(ord(inp) + 1))