peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N=int(input())
E={"*":0}
for _ in range(N):
    S=input()
    if S in E:
        E[S]+=1
    else:
        E[S]=1

M=int(input())
for _ in range(M):
    S=input()
    if S in E:
        E[S]-=1
    else:
        E[S]=-1

print(max(E.values()))
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 1000000007
def inv(y, mod):
    return pow(y, mod - 2, mod)

def comb(n, a, mod):
    x = 1
    y = 1
    for i in range(a):
        x = x * (n - i) % mod
        y = y * (i + 1) % mod
    return (x * inv(y, mod)) % mod
    
print((pow(2, n, mod) - 1 - comb(n, a, mod) - comb(n, b, mod)) % mod)
# Judge status: Wrong Answer
import numpy as np

n = int(input())
a = list(map(int, input().split()))
q = int(input())
for i in range(q):
    B, C = map(int, input().split())
    # for j in range(0, len(a)):
    #     if b == a[j]:
    #         a[j] = c
    print(sum(np.where(a == B, C, a)))
# Judge status: Accepted
tmp = list(map(int, input().split()))
x, y, a, b, c = tmp
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort()
q.sort()
p = p[a-x:]
q = q[b-y:]

p.extend(q)
p.extend(r)
p.sort()
print(sum(p[len(p)-x-y:]))
# Judge status: Accepted
from operator import mul
from functools import reduce
import bisect
n = int(input())
A = sorted(list(map(int, input().split())))

big_num = A[-1]
near_mid_pointer = bisect.bisect_left(A, big_num / 2)
dif1 = 10**9 + 1
if near_mid_pointer != 0:
        dif1 = big_num / 2 - A[near_mid_pointer - 1]
dif2 = A[near_mid_pointer] - big_num / 2
if dif1 <= dif2:
    num1 = big_num
    num2 = A[near_mid_pointer - 1]

else:
    num1 = big_num
    num2 = A[near_mid_pointer]

print(num1, num2)
# Judge status: Wrong Answer
a,b = list(map(int, input().split())) 
if a >= 10:
  print(b)
else:
  print(b-1000+100*a)
# Judge status: Accepted
out=["No","Yes"]
n=int(input())
li=list(map(int,input().split()))
print(out[max(li)*2<sum(li)])
# Judge status: Wrong Answer
a=int(input())
print(a/2 if a%2 == 0 else (a-1)/2+1)
# Judge status: Accepted
A,B,H,M = map(int,input().split())
# 角度
import math
Ar=H*30+M*0.5
Br=M*6
l=(A**2+B**2-2*A*B*math.cos(math.radians(abs(Ar-Br))))**0.5
print(l)
# Judge status: Accepted
N, D = (int(nd) for nd in input().split())
X = []
for _ in range(N):
    X.append([int(x) for x in input().split()])

index = 0
count = 0
for x in X:
    for y in X[index+1:]:
        dist = sum([(x[i]-y[i])**2 for i in range(D)])**(1/2)
        if dist == int(dist):
            count += 1
    index += 1

print(count)
# Judge status: Accepted
N, = map(int, input().split())
X = list(map(int, input().split()))

f=t=0
for x in X:
    if x % 4==0:
        f += 1
    elif x % 2==0:
        t += 1
if 2*f+1 >= N or 2*f+t>=N:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()
if s[::2].count("L")==0 and s[1::2].count("R")==0: print("Yes")
else: print("No")
# Judge status: Accepted
# import bisect
# from collections import Counter, defaultdict, deque, namedtuple
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n, k = list(map(int,ipti().split()))
    s = list(input())
    s[k-1] = s[k-1].lower()
    print(''.join(s))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
num = map(int, input().split())

print(num)
# Judge status: Accepted
N, C, K = map(int, input().split())
T = sorted(list(int(input()) for _ in range(N)))

bus = 0
pa = 1
S = T[0]

for i in T[1:]:
    pa += 1
    if K < i-S or pa > C:
        bus += 1
        pa = 1
        S = i
print(bus+1)
# Judge status: Accepted
n=int(input())
a = list(map(int, input().split()))
for i in a:
  if i % 2==0:
    if i % 3 == 0 or i % 5 ==0:
      continue
    else:
      print('DENIED')
      exit()
      
print('APPROVED')
# Judge status: Wrong Answer
S = input()
count = 0
for i in range(len(S)):
  if i%2 != 0 and S[i] != 'L':
    count = count+1
  elif i%2 == 0 and S[i] != 'R':
    count = count+1
if count == len(S):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
cat, animal, just = map(int, input().split())
print("YES" if cat<=just<=cat+animal else "NO")
# Judge status: Accepted
import itertools
s = input()
plm = ['+','-']

for i in itertools.product(plm, repeat=3):
    moziretsu =s[0]+i[0]+s[1]+i[1]+s[2]+i[2]+s[3]
    if eval(moziretsu) == 7:
        print(moziretsu+'=7')
        break
# Judge status: Wrong Answer
f=0
s=list(input())
if len(s)==1:
    print('No')
    f=1
else:
    for i in range(len(s)):
        if i%2==1:
            if s[i]!='i':
                f=1
                print('No')
                break
        else:
            if s[i]!='h':
                f=1
                print('No')
                break
if f==0:
    print('Yes')
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = set(a)
x = {str(i):0 for i in b}
for i in a:
    x[str(i)] += 1
ans = 0
for i,j in x.items():
    if j < int(i):
        ans += j
    else:
        ans += j - int(i)
print(ans)
# Judge status: Accepted
#codng utf-8
N,M=map(int,input().split())
B=[1]*(N+1)
F=[0]*(N+1)#0がある場所
F[1]=1


for i in range(M):
    a,b=map(int,input().split())
    if F[a]==1:
        if B[a]==1:
            F[a]=0
            F[b]=1
        else:
            F[b]=1
        B[a]-=1
        B[b]+=1
    else:
        B[a]-=1
        B[b]+=1


print(F.count(1))
# Judge status: Accepted
def heiho(a):
    for i in range((10**5)*2):
        if i**2==a:
            return True

a,b=input().split()
c=a+b
if heiho(int(c)):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N, M = list(map(int, input().split()))
paths = [list(map(int, input().split())) for _ in range(M)]

roads = {i : 0 for i in range(N)}
for path in paths:
  roads[path[0]-1] +=1
  roads[path[1]-1] +=1

for i in range(N):
  if not roads[i] == 0:
    print(roads[i])
# Judge status: Wrong Answer
a, b, c, x, y = map(int, input().split())

if a > 2*c and b > 2*c:
    ans = 2*c*max(x, y)  
elif a + b > 2*c:
    if x < y:
        ans = 2*c*x + b*(y-x)
    else:
        ans = 2*c*y + a*(x-y)
else:
    ans = a*x + b*y

print(ans)
# Judge status: Accepted
N = int(input())
S = input()

tmp = S[1:].count('E')
  
minimum = tmp

for i in range(1, N):
    if S[i-1] == 'W':
        tmp += 1
    if S[i] == 'E':
        tmp -= 1
    minimum = min(tmp, minimum)

print(minimum)
# Judge status: Accepted
n = input()

if n[1:] == '9'*(len(n)-1):
    print(int(n[0]) + (len(n)-1)*9)
else:
    print(int(n[0])-1 + (len(n)-1)*9)
# Judge status: Wrong Answer
n = int(input())
sn = "0" + str(n)
ans = 0
ren = 0
now = 0
for i in sn[::-1]:
  i = int(i)
  if i < 5:
    if ren == 1:
      now = 0
    ans += i + now
    now = 0
    ren = 0
  else:
    if i == 5:
      ren += 1
    ans += 10 - i - now
    now = 1
print(ans)
# Judge status: Wrong Answer
N = int(input())

A = []
B = []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

A, B = sorted(A), sorted(B)

max_B = max(B)
sum_A = sum(A)

if (sum_A > max_B):
    print('No')
    exit()
else:
    count = 0
    for i in range(N):
        count += A[i]

        if (count > B[i]):
            print('No')
            exit()
        else:
            continue

    print('Yes')
# Judge status: Accepted
n,m=map(int,input().split())
listn=[]
listm=[]
ans=[]
num=0
for i in range(n):
    listn.append(input().split())
for i in range(m):
    listm.append(input().split())
for i in range(n):
    numx=int(listn[i][0])
    numy=int(listn[i][1])
    count=10**10
    for j in range(m):
        numd=abs(int(listm[j][0])-numx)+abs(int(listm[j][1])-numy)
        if count>numd:
            count=numd
            num=j+1
    ans.append(num)
for i in range(n):
    print(ans[i])
# Judge status: Wrong Answer
N = int(input())
A = sorted(map(int, input().split()))

print(sum(A[1:]))
# Judge status: Accepted
a = 100
n = int(input())
c = 0
while(True):
    a += int((a * .01))
    if(a >= n):
        break
    c += 1   
print(c + 1)
# Judge status: Accepted
N,L = map(int,input().split())

s = 0
for i in range(1,N+1):
    s += L+i-1

if L > 0:
    eat = L
elif L+N-1 < 0:
    eat =  L+N-1
else:
    eat = 0

print(s-eat)
# Judge status: Wrong Answer
from collections import deque
n = int(input())
v = list(map(int,input().split()))
v.sort()
ans = 0
v = deque(v)
while(len(v) > 1):
    v.append(((v.popleft()+v.popleft())/2))
print(v[0])
128
149
# Judge status: Wrong Answer
N = int(input())
c = {(str(i), str(j)):0 for i in range(10) for j in range(10)}
for i in range(1, N):
    s = str(i)
    c[(s[0], s[-1])] += 1
ans = 0
for i in range(10):
    for j in range(10):
        i, j = str(i), str(j)
        ans += c[(i, j)] * c[(j, i)]
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

k0 = 0
k2 = 0
k4 = 0

for a in A:
  if a%4==0:
    k4 += 1
  elif a%2==0:
    k2 += 1
  else:
    k0 += 1
print(k4,k2,k0)
# 2で割り切れるものをひとまとめにしk0としてみなす
if k2 > 0:
  k0 += 1

if k0 > k4+1:
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
import math
import numpy as np

N,D = map(int, input().split())
xy = [map(int, input().split()) for _ in range(N)]
x, y = [list(i) for i in zip(*xy)]

X = np.square(x)
Y = np.square(y)

c = 0

for j in range(N):
  Z = X[j] + Y[j]
  if np.sqrt(Z) >= D:
    c+=1
  j += 1
    
print(c)
# Judge status: Wrong Answer
n=int(input())
i=1
while i**2<n:
  i+=1
print(i**2)
# Judge status: Accepted
N, L, *S = open(0).read().split()
S.sort()
print(''.join(S))
# Judge status: Accepted
N,Y=map(int,input().split())
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            print(x,y,z)
            exit()

print(-1,-1,-1)
# Judge status: Wrong Answer
S = list(str(input()))
K = int(input())

ind = 0
for s in S:
    i = int(s)

    if i == 1:
        num = pow(i, 5000000000000000)
    else:
        print(i)
        break
# Judge status: Wrong Answer
N , K = map(int , input().split())
A = list(map(int , input().split()))
if K >= (N-1):
    S = [N]*(N)
    print(*S)
# Judge status: Accepted
a, b = map(int, input().split())
s = input()
flag = True

for i in range(a):
  if s[i] == '-':
    flag = False
    break

if s[a] != '-':
  flag = False

for i in range(a + 1, a + b + 1):
  if s[i] == '-':
    flag = False
    break

if flag:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N,X = map(int,input().split())
L = list(map(int,input().split()))
count = 1
s = 0
for i in range(N):
    s += L[i]
    if s <= X:
        count += 1
print(count)
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input()) 
flag = 0

if A < B:
    a = V*T + A
    b = W*T + B
    if a >= b:
        flag = 1


else:
    a = A - V*T
    b = B - W*T
    if a <= b:
        flag = 1

if flag==1:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
p,q,r = map(int,input().split())
print(p + q + r)
# Judge status: Accepted
import math
n = int(input())
while n > 0:
    if math.sqrt(n) == int(math.sqrt(n)):
        print(n)
        exit()
    n -= 1
# Judge status: Wrong Answer
def compare(t,s):
  diff=0
  for i in range(len(s)):
    if s[i]!=t[i]:
      diff+=1
  return diff

t = input().strip()
s = input().strip()
smallchange = len(s)
for i in range(len(t)-len(s)+1):
  x = compare(t[i:len(s)+i], s)
  if smallchange > x:
    smallchange = x
 
print(x)
# Judge status: Accepted
x, y = map(int, input().split())

for a in range(x + 1):
    tem = 2 * a + 4 * (x - a)
    if (tem == y):
        #  and (2 * x <= y <= 4 * x):
        print('Yes')
        exit()

print('No')
# Judge status: Wrong Answer
a = str(input())
if a.isupper() == True:
    print('A')
else:
    print('B')
# Judge status: Accepted
D, N = map(int, input().split())

if(N == 100):
	N = 101
print(100**D*N)
# Judge status: Accepted
def main():
    N = int(input())
    ans = 0
    for n in range(1, N + 1):
        if len(str(n)) % 2 == 1:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b = map(int,input().split())
print(int(a + b / 2))
# Judge status: Wrong Answer
def f(n):
    if n%2==0:
        return n//2
    else:
        return (3*n)+1
s = int(input())
a = {str(s):1}
ans = 1
while(True):
    x = f(s)
    ans+=1
    if x in a:
        break
    else:
        a[x]=True
    s=x
print(ans)
# Judge status: Accepted
n=int(input())
for i in range(0,n//4+1):
    if (n-i*4)%7==0:
        print("Yes")
        exit(0)
print("No")
# Judge status: Accepted
a,b=input().split()
a=int(a)
b=int(b[0]+b[2:])
print((a*b)//100)
# Judge status: Accepted
hon = [2,4,5,7,9]
pon = [0,1,6,8]
s = input()
s = s[::-1]
hantei = int(s[0])
if hantei in hon:
  print('hon')
elif hantei in pon :
  print('pon')
else:
  print('bon')
# Judge status: Wrong Answer
import sys
s=input()
a=[int(s[i]) for i in range(4)]
p=[[a[1],"+"],[-a[1],"-"]]
q=[[a[2],"+"],[-a[2],"-"]]
r=[[a[3],"+"],[-a[3],"-"]]
for b,tb in p:
    for c,tc in q:
        for d,td in r:
            if a[0]+b+c+d==7:
                print(a[0],tb,b,tc,c,td,d,"=7");sys.exit()
# Judge status: Accepted
today_weather = input()

if today_weather == 'Sunny':
    tomorrow_weather = 'Cloudy'
    print(tomorrow_weather)

elif today_weather == 'Cloudy':
    tomorrow_weather = 'Rainy'
    print(tomorrow_weather)

elif today_weather == 'Rainy':
    tomorrow_weather = 'Sunny'
    print(tomorrow_weather)
# Judge status: Wrong Answer
n,m = map(int,input().split())
mn = 1
mx = n

for i in range(m):
    l,r = map(int,input().split())
    if l > mn:
        mn = l
    if r < mx:
        mx = r
        
if mx > mn:
    print(0)
else:
    print(mn - mx + 1)
# Judge status: Accepted
S=input()
if all(c  in 'RUD' for c in S[::2]) and all(c in 'LUD' for c in S[1::2]):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
d={}
ans=0
for i in l:
    if i not in d:
        d[i]=1
    else:
        d[i]+=1
for i in d.keys():
    x=d[i]*(d[i]-1)//2
    ans+=x
for i in l:
    if d[i]>2:
        print(ans-(d[i]*(d[i]-1)//2)+((d[i]-1)*(d[i]-2)//2))
    elif d[i]==2:
        print(ans-1)
    else:
        print(ans)
# Judge status: Accepted
x = list(input())
x = x[::-1]
counter = 0
ans = len(x)
for i in x:
    if i == "T":
        counter += 1
    elif i == "S" and counter:
        counter -= 1
        ans -= 2
print(ans)
# Judge status: Wrong Answer
mod=10**9+7
N,K=list(map(int,input().split()))
if (N+K)%3==0 and N*2>K and K*2>N:
   A=max(N,K)-min(N,K)
   low=(min(N,K)-A)//3
   all_pt=low*2+A
else:
   print(0)
   exit()
up,down=1,1
for i in range(low):
   up=up*(all_pt-i)%mod
   down=down*(i+1)%mod
base=pow(down,mod-2,mod)
print(up*base%mod)
# Judge status: Accepted
s = input()
n = len(s)
if n % 2 == 1:
    print("No")
elif s.count("hi") == n // 2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import math
A,B,C= map(int, input().split())
if math.floor(B % A) >= C:
  print(math.floor(B % A))
else:
  print(C)
# Judge status: Wrong Answer
def gcd(a,b):
	a,b=max(a,b),min(a,b)
	return a if b==0 else gcd(b,a%b)
def GCD(t):
	if len(t)==0:
		return 0
	l=t[0]
	r=t[-1]
	for i in range(1,len(t)//2):
		l=gcd(l,t[i])
		r=gcd(r,t[-i-1])
	return gcd(l,r)

n=int(input())
a=list(map(int,input().split()))
m=1
l=0
r=0
for i in range(n):
	l=GCD(a[:i])
	r=GCD(a[i+1:])
	m=max(gcd(l,r),m)
print(m)
# Judge status: Accepted
n = int(input())
s = input()
b_lst=[]
w_lst=[]
b_cnt=0
w_cnt=0
for i in range(len(s)):
    b_lst.append(b_cnt)
    w_lst.append(w_cnt)
    if s[i]=="#":
        b_cnt+=1
    if s[len(s)-i-1]==".":
        w_cnt+=1
b_lst.append(b_cnt)
w_lst.append(w_cnt)
w_lst.reverse()

ans=10**9
for b,w in zip(b_lst,w_lst):
    if ans > b+w:
        ans=b+w
print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
big=-99999999999999999999999999999999999999999
if a*c>a*d:
    big=a*c
else:
    big=a*d

if b*c>big:
    big=b*c
if b*d>big:
    big=b*d

print(big)
# Judge status: Accepted
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
from collections import Counter
dic=Counter(a)
dic=sorted(dic.items(),key=lambda x:x[1])

ans=0
cnt=0
l=max(len(dic)-k,0)
for i in dic:
  if cnt==l:
    break
  ans=ans+i[1]
  cnt=cnt+1
print(ans)
# Judge status: Accepted
a,b,c = list(map(int,input().split()))
total = c-(a-b)
if total < 0:
  print(0)
else:
  print(total)
# Judge status: Accepted
a,b,c=[int(x) for x in input().split()]
l = 4*a*b
r = c-(a+b)
R = r*r
if r<0:
  print('No')
elif l < R:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

def main():
    n = ri()
    lp = rli()
    m = n+1
    ans = 0
    for p in lp:
        if p <= m:
            ans += 1
        m = min(m, p)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
s=input()
l=[]
L=[s[0]]
for i in range(2,len(s)-1):
    if s[i]=='C':
        L.append(s[i])
    else:
        l.append(s[i])
komoji=''.join(l)
komoji+=(s[1]+s[len(s)-1])

print('AC' if L==['A','C'] and str.islower(komoji) else 'WA')
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = []
B = []
for _ in range(N):
    x, y = map(int, readline().split())
    A.append(x+y)
    B.append(x-y)

a = max(A)
b = min(A)
c = max(B)
d = min(B)

print(max(abs(a-b),abs(c-d)))
# Judge status: Accepted
n,m = map(int,input().split())
if n==1 and m == 1:
  print(1)
  exit()
if n==1:
  print(m-2)
  exit()
if m == 1:
  print(n-2)
  exit()
print((n-2)*(m-2))
# Judge status: Accepted
n = int(input())
x = list(map(int,input().split()))
M = max(x)
s = [0]*(10*M)

for j in range(10*M):
	for i in range(n):
		s[j] += pow(x[i]-(j-5*M),2)
print(min(s))
# Judge status: Wrong Answer
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,T = LI()
ct = [LI() for _ in range(n)]
ct.sort()
for c,t in ct:
    if t < T:
        print(c)
        quit()
print('TLE')
# Judge status: Accepted
n, x = map(int, input().split())

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


state = 0

ans = 0

for i in range(n-1):
    if a[i] + a[i+1] > x:
        if a[i] > x:
            ans += a[i] - x
            a[i] = x
        ans += a[i] + a[i+1] - x
        a[i+1] = x - a[i]

print(ans)
# Judge status: Accepted
def d_redistribution(MOD=10**9 + 7):
    S = int(input())
    if S in (1, 2):
        return 0

    ans = [0] * (S + 1)
    ans[3] = 1
    for n in range(3, S + 1):
        ans[n] += ans[n - 1] + ans[n - 3]
        ans[n] %= MOD
    return ans[S]

print(d_redistribution())
# Judge status: Wrong Answer
a=int(input())
b=list(map(int,input().split()))
b.sort()
print(b[1])
# Judge status: Wrong Answer
n,y=map(int,input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if y==10000*i-5000*j-1000*(n-i-j):
            print(i,j,n-i-j)
            exit()
print("-1,-1,-1")
# Judge status: Accepted
s=input()
t=input()
count=0
for i in range(len(s)):
    if s[i]!=t[i]:
        count+=1
print(count)
# Judge status: Wrong Answer
x, n = map(int, input().split())
p = list(map(int, input().split()))

if n == 0:
    print(x)
    exit()

Flag = True
i = 1
while Flag:
    if x - i not in p:
        print(x - i)
        break
    elif x + i not in p:
        print(x + i)
        break
    i += 1
# Judge status: Accepted
#template
def inputlist(): return [int(j) for j in input().split()]
def listinput(): return input().split()
#template
def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)
N,K = inputlist()
print(len(base10to(N,K)))
# Judge status: Accepted
n,m = map(int, input().split())
a = list(map(int, input().split()))
s = 0
total = sum(a)
for i in a:
    if total/(4*m) <= i:
        s += 1

if s >= m:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
r, g, b = map(int, input().split())
num = 10*g + b
if num % 4 == 0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
a = input()
s = a.isupper()
if s == True: print('A')
else: print('a')
# Judge status: Accepted
def LI():
    return list(map(int, input().split()))


X, Y = LI()
a = 10**18//X
if X == Y:
    ans = -1
elif X % Y == 0:
    ans = -1
else:
    for i in range(2, a+1):
        if X*i % Y == 0:
            continue
        ans = X*i
        break
print(ans)
# Judge status: Accepted
n = int(input())
s = input()
maxi = 0
for i in range(n):
  left  = s[:i+1]
  right = s[i+1:]
  left = set(list(left))
  right = set(list(right))
  cnt = len(left & right)
  if maxi < cnt:
    maxi = cnt
print(maxi)
# Judge status: Accepted
import bisect
from collections import deque

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

LIS = deque([a[0]])
for i in range(1,N):
    if a[i] > LIS[-1]:
    	LIS[-1] = a[i]
    elif LIS[0] >= a[i]:
    	LIS.appendleft(a[i])
    else:
    	LIS[bisect.bisect_left(LIS, a[i])-1] = a[i]

print(len(LIS))
# Judge status: Accepted
import math
m = input()

s = 100
c = 0
count = 1
for i in range(100, int(m)):
  c = s * 0.01
  s = s + math.floor(c)
  if s >= int(m):
    print(count)
    break
  count = count + 1
# Judge status: Wrong Answer
n,m = map(int,input().split())
ac_dir = {}
wa_dir = {}

for _ in range(m):
    p, s = input().split()
    if s == 'AC' and p not in ac_dir:
        ac_dir[p] = 1
    
    elif s == 'WA' and p not in wa_dir and p not in ac_dir:
        wa_dir[p] = 1
    
    elif s == 'WA' and p in wa_dir and p not in ac_dir:
        wa_dir[p] += 1

print(sum(ac_dir.values()), sum(wa_dir.values()))
# Judge status: Accepted
N = int(input())

if N % 1000 == 0:
    print(0)
else:
    print((N // 1000 + 1) * 1000 - N)
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))
a = []
p = [0]*n
c = 0
for i in range(0,n-1):
  if(h[i] >= h[i+1]):
    p[i] = 1
    
for i in range(0,n):
  if(p[i] != 0):
    c += 1
  else:
    a.append(c)
    c = 0
print(max(a))
# Judge status: Accepted
s=input()
print(s + 'e' * (s[-1] == 's') + 's')
# Judge status: Accepted
d,n=map(int,input().split())
print(100**d*(n+n//100))
# Judge status: Accepted
n = input()
w = map(int,raw_input().split())
l = []
for i in xrange(n):
    res = abs(sum(w[:i]) - sum(w[i:]))
    l.append(res)
print min(l)
# Judge status: Accepted
K = int(input())
A, B = map(int, input().split())
C = range(A,B+1)
for i in C:
  if i % K == 0:
    P = 0
    break
  else:
    P = 1
  
if P == 0:
  print("OK")
elif P == 1:
  print("NG")
# Judge status: Wrong Answer
a,b,c=map(int, input().split())

print(max(a*10+b+c, a+b*10+c))
# Judge status: Accepted
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    ABC = sorted(list(map(int, input().split())))

    for i in ABC:
        if i % 2 == 0:
            print(0)
            break
    else:
        print(ABC[0] * ABC[1])


if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
lia = []
lib = []

for i in range(n):
    if not(a[i] == b[i] or a[i] +1 == b[i]):
        lia.append(a[i])
        lib.append(b[i])

sum_a = sum(lia)
sum_b = sum(lib)

if sum_a > sum_b or (sum_b-sum_a)%2 !=0:
    print("No")
    exit()
print("Yes")