peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10**9 + 7

def combi_mod(n, r, mod):
    numerator = 1
    denominater = 1
    for i in range(r):
        numerator = numerator * (n-i) % mod
        denominater = denominater * (i+1) % mod
    return numerator * pow(denominater, mod - 2, mod) % mod

print((pow(2, n, mod) -1 - combi_mod(n, a, mod) - combi_mod(n, b, mod)) % mod)
# Judge status: Accepted
A = list(input())
B = list(input())
C = list(input())
s = A.pop(0)
while True:
    if A == [] and s == 'a':
        print('A')
        exit()
    elif B == [] and s == 'b':
        print('B')
        exit()
    elif C == [] and s == 'c':
        print('C')
        exit()
    if s == 'a':
        s = A.pop(0)
    elif s == 'b':
        s = B.pop(0)
    elif s == 'c':
        s = C.pop(0)
# Judge status: Accepted
from collections import *
N = int(input())
C = Counter(map(int,input().split()))
A = [0,0]
B = [0]

for k,v in C.items():
  if 2<=v:
    A+=[k]
  if 4<=v:
    B+=[k]

A.sort()
B.sort()
print(max(A[-1]*A[-2],B[-1]**2))
# Judge status: Accepted
N = int(input())
line = [int(i) for i in input().split()]
sum = 1
line.sort(reverse=True)
if line[len(line) -1]== 0:
  print(0)
  exit()
for num in line:
  sum = sum * num
  if sum > 10 ** 18:
    print(-1)
    exit()
print(sum)
# Judge status: Accepted
n=int(input())
A=list(map(int, input().split()))

s=A[0]
S=sum(A)
ans=abs(sum(A) - 2*s)
for i in range(1,n-1):
	s += A[i]
	ans = min(ans, abs(S - 2*s))

if n > 3:
	print(ans)
else:
	print(abs(A[1]-A[0]))
# Judge status: Wrong Answer
def main():
    X = int(input())
    for A in range(-50, 51):
        for B in range(-50, 51):
            if A**5 - B**5 == X:
                print(A, B)
                exit()
if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
input = [str(input()) for i in range(2)]
s_list = sorted(input[0])
t_list = sorted(input[1], reverse=True)

def main():
    # tが小さければno
    for s, t in zip(s_list, t_list):
        if s < t:
            return 'Yes'
        elif s > t:
            return 'No'

    if len(s) >= len(t):
        return 'No'
    else:
        return 'Yes'

print(main())
# Judge status: Accepted
a,b = map(int,input().split())
s = input()
for i in range(a+b+1):
  if i == a:
    if s[i] != "-":
      print("No")
      exit()
  else:
    if s[i] == "-":
      print("No")
      exit()
print("Yes")
# Judge status: Wrong Answer
a,b,c=map(int,raw_input().split())
if a+b>c:
  print "yes"
else:
  print "no"
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))

ans = 0
min_ = P[0]
for i in range(N):
    if min_ >= P[i]:
        ans += 1
    min_ = min(min_, P[i])

print(ans)
# Judge status: Accepted
c = [list(map(int, input().split())) for _ in range(3)]
flg = all(
    c[0][i + 1] - c[0][i] == c[1][i + 1] - c[1][i] == c[2][i + 1] - c[2][i]
    and c[i + 1][0] - c[i][0] == c[i + 1][1] - c[i][1] == c[i + 1][2] - c[i][2]
    for i in range(2)
)
print(["No", "Yes"][flg])
# Judge status: Wrong Answer
N = int(input())
S = list(input())

ans = []
ans.append(len(set(S)))
for i in range(N):
    if i == 0:
        pass
    elif S[i] == S[i-1]:
        pass
    else:
        S_f = S[:i+1]
        S_b = S[i+1:]
        F = set(S_b)
        B = set(S_f)
        ans.append(len(F&B))
        
print(max(ans))
# Judge status: Accepted
H,W=map(int,input().split())
print(abs((H-2)*(W-2)))
# Judge status: Accepted
n = int(input())

a = [list(map(int,input().split())) for i in range(2)]

total = 0
st_num = 0
max_num = 0
for i in range(n):
    st_num += a[0][i]
    for j in range(i,n):
        total += a[1][j]
    if max_num < st_num+total:
        max_num = st_num+total
    total = 0
print(max_num)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
#print(a+b+c)
if (a+b+c)%3 == 0:
    print("Yes")
else :
    print("No")
# Judge status: Accepted
N=int(input())
n=N//1.08
a=int(n*1.08)
b=int((n+1)*1.08)
print(int(n) if a==N else int(n+1) if b==N else ":(")
# Judge status: Wrong Answer
A,B=map(int,input().split())
if A>=13:
  print(B)
elif 6<=B<=12:
  print(B/2)
else:
  print(0)
# Judge status: Wrong Answer
i = list(map(int, input().split()))
j= list(map(int, input().split()))
x=sorted(j, reverse=True)
z=0

if i[1]>=len(j):
  print(0)
else:
  for a in range(i[0],len(x)):
    z+=x[a]
  print(z)
# Judge status: Accepted
A, B = map(int, input().split())

import math
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

c = prime_factorize(math.gcd(A, B))
c = collections.Counter(c)
c = c.values()

print(len(c) + 1)
# Judge status: Accepted
a, b, c = map(int, input().split())
print(c, a, b)
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1,2):
    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=int(input())
x=800*n
y=200*(n//15)
ans=x-y
print(ans)
# Judge status: Wrong Answer
import sys
A,B = map(int,input().split())

if A < 0 or B < 0 or A > 100 or B > 100:
    sys.exit()

if A % 3 or B % 3 or (A + B) % 3:
    print("Possible")
else:
    print("Impossible")
# Judge status: Accepted
s = input()
l = s.split(' ')

if(int(l[0]) <= int(l[1]) * int(l[2])):
	print("Yes")
else:
	print("No")
# Judge status: Accepted
ab = [int(i) for i in input().split()]

if all(i <= 8 for i in ab):
	print('Yay!')
else:
	print(':(')
# Judge status: Wrong Answer
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

x,y=mp()
for i in range(10*5):
    x*=2
    if x>y:
        print(i+1)
        exit()
# Judge status: Accepted
import math

def isPrime(x):
  if x == 1: return False
  
  for k in range(2, int(math.sqrt(x) + 1)):
    if x % k == 0:
      return False
  return True

n = int(input())

while True:
  if isPrime(n):
    print(n)
    break
  n += 1
# Judge status: Accepted
A,B,C=map(int,input().split())

if A+B>=C:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N, M = [int(i) for i in input().split()]

cnt = 0

if N  <= M // 2:
    cnt = N
    M = M - (2 * N)
    N = 0
    cnt += M // 4
else :
    cnt = M // 2
print(cnt)
# Judge status: Wrong Answer
n,d=map(int,input().split())

if n%(2*d)==0:
  print(n//(2*d))
else:
  print((n//(2*d))+1)
# Judge status: Accepted
p, q, r = map(int, input().split())
flights = {
"a_b_c": p + r,
"a_c_c": q + r,
"c_b_a": q + p
}
print(min(flights.values()))
# Judge status: Accepted
from collections import Counter

S = input()
c = Counter(S)
v = [c[l] for l in 'abc']
print('YES' if max(v) - min(v) <= 1 else 'NO')
# 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')
        break
else:
    print('NG')
# Judge status: Accepted
A, B, C, X = map(lambda x: int(x) + 1, [input() for q in range(4)])
r = 0
for a in range(A):
    for b in range(B):
        for c in range(C):
            if (500 * a + 100 * b + 50 * c) == (X - 1):
                r += 1
print(r)
# Judge status: Accepted
N = int(input())
A = sorted(map(int, input().split()))[::-1]
I = [1+2*i for i in range(N)]
print(sum(A[i] for i in I))
# Judge status: Accepted
import math
N,K = map(int, input().split())
ans = 0
for n in range(1, N + 1):
    cnt = 0
    sums = n
    while sums < K:
        sums *= 2
        cnt += 1
    ans += 0.5 ** cnt
print(ans/N)
# Judge status: Accepted

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

if len(a) != len(set(a)):
    print("NO")
else:
    print("YES")
# Judge status: Accepted
import math

h = int(input())
w = int(input())
n = int(input())

print(math.ceil(n/max(h,w)))
# Judge status: Accepted
N = int(input())
x = list(map(int, input().split(' ')))
y = list(map(int, input().split(' ')))

count = x[0]
for i in range(N):
    count += y[i]

sums = count
for i in range(N - 1):
    count = count + x[i + 1] - y[i]
    if count > sums:
        sums = count

print(sums)
# Judge status: Wrong Answer
N = int(input())
maxdiv = 0
ans = 0
for i in range(1, N + 1):
    d = i
    count = 0
    while d & 1 == 0:
        d >>= 1
        count += 1
    if count > maxdiv:
        ans = i
        maxdiv = count
print(ans)
# Judge status: Accepted
def main():
    n = input()
    a, b = 0, 1
    for i in n:
        x = int(i)
        a, b = min(a + x, b + 10 - x), min(a + x + 1, b + 10 - x - 1)
    print(a)

main()
# Judge status: Accepted
import collections
from itertools import combinations
import sys
input = sys.stdin.readline

N = int(input())
s = [''.join(sorted(list(input()))) for _ in range(N)]
c = collections.Counter(s)

cnt = 0
for i in c.values():
    if i > 1:
        cnt += i*(i-1)//2
print(cnt)
# Judge status: Accepted
n, m = map(int, input().split())

if n >= m:
    print(0)
    exit()
    
lis = list(map(int, input().split()))
lis.sort()

res = []
for i in range(m - 1):
    res.append(lis[i + 1] - lis[i])
res.sort()

l = len(res)
k = n - 1

print(sum(res[:l - k]))
# Judge status: Wrong Answer
N = int(input())
W = list(map(int,input().split()))
s = sum(W)
count = 0
for i in range(N):
    count += W[i]
    if count >= s/2:
        print(2*count - s)
        break
# Judge status: Accepted
N=int(input())
A=["a"]
S="abcdefghijklmn"
for i in range(N-1):
    B=[]
    for a in A:
        for s in S[:len(set(a))+1]:
            B.append(a+s)
    A=B[::]
print("\n".join(A))
# Judge status: Accepted
n,d=map(int,input().split())
d**=2
print(len([_ for _ in '1'*n if sum(map(lambda x: int(x)**2, input().split()))<=d]))
# Judge status: Accepted
n,k = map(int,input().split())
H = sorted([int(input()) for i in range(n)])
ans = H[-1]

for i in range(n-k+1):
    x = H[i+k-1] - H[i]
    ans = min(ans,x)
    
print(ans)
# Judge status: Wrong Answer
s = input()
if s <= "2019/4/30":
  print("Heisei")
else:
  print("TBD")
# Judge status: Accepted
x, k, d = map(int, input().split())
x = abs(x)
if (x - k*d) >= 0:
    x -= k*d
else:
    k -= int(x/d)
    x -= int(x/d) * d
    if (k%2) != 0:
        x -= d 
print(abs(x))
# Judge status: Accepted
import sys
s = str(input())
for i in range(len(s)):
     if i % 2 ==0:
          if s[i] == 'L':
               print('No')
               sys.exit()
     if i % 2 ==1:
          if s[i] == 'R':
               print('No')
               sys.exit()
print('Yes')
# Judge status: Accepted
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    a,b = map(int, input().split())
    ans = max(a,b)
    first = ans
    m = min(a,b)
    while True:
        if ans%m == 0:
            print(ans)
            exit()
        ans += first

if __name__=="__main__":
    main()
# Judge status: Wrong Answer
S=str(input())
T=str(input())
if len(S)==1 and S[0]==T[0] and len(T)==2:
  print('Yes')
elif len(T.replace(S,''))==1:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
import collections
import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
li = []
ans = 0

for i in range(n):
    s = list(input())
    s.sort()
    li.append(''.join(s))

c = list(collections.Counter(li).values())

for i in c:
    if i == 1:
        break
    ans += combinations_count(i, 2)

print(ans)
# Judge status: Accepted
X,Y=map(int,input().split())
ans=0
for i in range(10000):
  if X*(2**i) > Y:
    print(i)
    break
# Judge status: Accepted
N,D=map(int,input().split())
import math
print(math.ceil(N/(2*D+1)))
# Judge status: Wrong Answer
S = str(input())
if S[0] + S[1] + S[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
K = int(input())
A = list(map(int, input().split()))

sum = 1000
kabu = 0

for k in range(K):
    if k+1 ==K:
        sum +=kabu*A[K-1]
        break
    if A[k]<A[k+1] and A[k]<=sum:
        S = int(sum/A[k])
        sum = sum-A[k]*S
        kabu +=S
    elif A[k]>A[k+1] and kabu != 0:
        sum = sum + kabu * A[k]
        kabu = 0
    

print(sum)
# Judge status: Accepted
n=int(input())
A=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))
print(sum(abs(a-A[n//2])for a in A))
# Judge status: Accepted
a,b,c,d = map(int,input().split())

flag = True
while flag:
  c -= b
  if c <= 0:
    print("Yes")
    flag = False
  else:
    a -= d
    if a <= 0:
      print("No")
      flag = False
# Judge status: Accepted
# -*- coding: utf-8 -*-
import math

H = int(input())
W = int(input())
N = int(input())

if H >= W:
    out = math.ceil(N / H)
else:
    out = math.ceil(N / W)

print(out)
# Judge status: Wrong Answer
a,b=map(int,input().split())
if a-b==1 and a-b==0:
	print("Yay!")
else:
		print(":(")
# Judge status: Accepted
m, n = map(int, input().split())
li = list(map(int, input().split()))
if n >= m:
  print(0)
elif n == 0:
  print(sum(li))
else:
  print(sum(sorted(li)[:-n]))
# Judge status: Accepted
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = list(input())

point = 0
for i in range(n):
    if (i >= k) & (t[i] == t[i - k]):
        t[i] = 'a'
        continue
    else:
        if t[i] == 'r':
            point += p
        elif t[i] == 's':
            point += r
        else:
            point += s
print(point)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    w,h,x,y=map(int, input().split())
    ans=w*h*0.5
    if x==w/2 and y==h/2:
        print(ans,1)
    else:
        print(ans,0)
resolve()
# Judge status: Accepted
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

def main():
    S = input()
    print(min(abs(int(S[i:i + 3]) - 753) for i in range(len(S) - 2)))

main()
# Judge status: Wrong Answer
def main():
    S = input()
    first = int(S[0:2])
    last = int(S[2:4])

    if(first>12 and last<=12):
        print("YYMM")
    elif(last>12 and first<=12):
        print("MMYY")
    elif(last<=12 and first<=12):
        print("AMBIGUOUS")
    else:
        print("NA")
    
    return
main()
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
A = list(map(int,input().split()))
C = collections.Counter()
for i ,ai in enumerate(A):
  ans += C[i-ai]
  C[ai+i] += 1
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ans = 0
i = 0
while True:
	if A[i] % 2 == 0:
		A[i] /= 2
	else:
		break
	if i == N-1:
		i = 0
		ans += 1
	else:
		i += 1
print(ans)
# Judge status: Wrong Answer
def main():
    n,k = map(int,input().split())
    a = list(map(int,input().split()))

    ans = []
    for i in range(k,n):
        ans.append("Yes" if a[i] > a[i-k] else "No")

    print("/n".join(ans))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
x, k, d = map(int, input().split())
x = abs(x)
s = int(x/d)

if k < s:
    print(x-d*k)
else:
    if x-s*d < abs(x-(s+1)*d):
        if (k-s)%2 == 0:
            print(x-s*d)
        else:
            print(abs(x-(s+1)*d))
    else:
        if (k-s)%2 == 0:
            print(abs(x-(s+1)*d))
        else:
            print(x-s*d)
# Judge status: Wrong Answer
n = int(input())

last = ""
for i in range(n):
    s = input()
    if i == 0:
        last = s
    last_dummy = ""
    s_dummy = s
    for j in range(len(last)):
        for k in range(len(s)):
            if last[j] == s_dummy[k]:
                last_dummy += last[j]
                s_dummy.strip(s[k])
                break
    last = last_dummy
ans_list = sorted(last)
ans = ""
for i in ans_list:
    ans += i

print(ans)
# Judge status: Wrong Answer
from math import ceil
from fractions import Fraction
from sys import exit
import heapq

n,k, *aa = map(int, open(0).read().split())

left = 1
right = sum(aa)
mid = (left + right) // 2

while right - left > 1:
    summ = sum(ceil(a/mid)-1 for a in aa)
    if summ <= k:
        right = mid
        mid = (left + right) // 2
    else:
        left = mid
        mid = (left + right) // 2

print(right)
# Judge status: Accepted
AC = 0
WA = 0
TLE = 0
RE = 0

a_list = [input() for j in range(int(input()))]

for a in a_list:
  if a == "AC":
    AC += 1
  elif a == "WA":
    WA += 1
  elif a == "TLE":
    TLE += 1
  else:
    RE += 1
  
print(f"AC x {AC}\nWA x {WA}\nTLE x {TLE}\nRE x {RE}")
# Judge status: Wrong Answer
import numpy as np;
from numba import jit
import warnings
warnings.simplefilter('ignore')

@jit
def slove(ans, A):
    for a in A:
        ans *= a
    return ans



if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    
    ans = slove(1, A)
    if ans > 10 ** 18:
        print(-1)
        quit()
    print(ans)
# Judge status: Wrong Answer
A , B = map(int,input().split())
if (A + B)<=24:
    print(A + B)
elif (A + B)>24:
    print(A + B - 24)
# Judge status: Accepted
n = int(input())
al = list(map(int, input().split())) 
q = int(input())

from collections import Counter
count = Counter(al)

als = sorted(al)
dp = [0]*(10**5+1)
res = sum(als)

for i in range(10**5+1):
    dp[i] =count[i]

for j in range(q):
    a,b = map(int, input().split())
    res += dp[a] * (b-a)
    dp[b] += dp[a]
    dp[a] = 0
    print(res)
# Judge status: Accepted
S = input()
if len(S) % 2 == 1:
    S = S[-1]
for i in reversed(range(2, len(S) + 1, 2)):
    length = i
    fl = 0
    for j in range(i // 2):
        # print(S[j], S[j + length // 2])
        if S[j] != S[j + length // 2]:
            fl = 1
    if fl == 0 and length != len(S):
        print(length)
        exit()
# Judge status: Accepted
a, b = map(int, input().split())
lst = [i for i in range(2, 14)] + [1]
if a == b:
  print('Draw')
else:
  print(['Bob', 'Alice'][lst.index(a) > lst.index(b)])
# Judge status: Accepted
X = int(input())
X = 2000 - (X+1)
X //= 200
print(X + 1)
# Judge status: Accepted
X, Y = map(int, input().split())
import math
mod = pow(10,9) + 7
a = 2*Y -X
b = 2*X -Y
if a % 3 == 0 and b % 3 == 0 and a >= 0 and b >= 0:
  k = a // 3
  l = b // 3
  c = max(k, l)
  d = min(k, l)
  bunshi = 1
  bunbo = 1
  for i in range(c+1,c+d+1):
    bunshi = bunshi * i % mod
  for i in range(1,d+1):
    bunbo = bunbo * i % mod
  ans = bunshi * pow(bunbo, mod-2, mod) % mod
  print(ans)
else:
  print(0)
# Judge status: Accepted
s=list(input())
s.sort()
if s[0]==s[1] and s[2]==s[3] and s[1]!=s[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys

N , W = map(int, input().split())

WV = [list(map(int, sys.stdin.readline().split())) for i in range(N)]

INF = 10**11+1

dp = [[0]*(1+W) for i in range(N+1)]

for i in range(1, N+1):
    for j in range(1, W+1):
        if j-WV[i-1][0]>=0:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-WV[i-1][0]]+WV[i-1][1])
        else:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-1])

print(dp[N][W])
# Judge status: Accepted
n,m,*z=map(int,open(0).read().split())
for i in range(10**n):
  S=str(i)
  if len(S)==n:
    if all(S[s-1]==str(c)for s,c in zip(z[0::2],z[1::2])):
      print(S)
      quit()
print(-1)
# Judge status: Accepted
import fractions
a, b = map(int, input().split())
ab = a * b
n = max(a, b)
gcd = int(fractions.gcd(a, b))
print(ab // gcd)
# Judge status: Accepted
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    K, X = LI()

    ans = list(range(X - K + 1, X + K))
    print(*ans)

if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
rem = a % b
tmp = 0
fa = a
ans = "No"
if(rem!=0):
    while (tmp != rem):
        a += fa
        tmp = a % b
        if (tmp == c):
            ans = "Yes"
            break
else:
    if(c==0):
        ans = "Yes"
print(ans)
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

S = V - W
print('NO' if S <= 0 or abs(A - B) > T * S else 'YES')
# Judge status: Accepted
n=int(input())
s,ans=list(input()),''
for i in s:
  ans+=chr((ord(i)-65+n)%26+65)
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
print((n+m)%24)
# Judge status: Accepted
import string


def resolve():
    N = int(input())

    alphabets = string.ascii_lowercase
    base_number = 26

    ans = ''
    while N > 0:
        N -= 1
        ans += alphabets[N % base_number]
        N = N // base_number

    print(ans[::-1])


resolve()
# Judge status: Wrong Answer
H, N = map(int,(input().split()))
A = list(map(int,(input().split())))
sum=0
for i in range(len(A)):
  sum += A[i]
if(sum>=N):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
s = input()
t = input()
if t == s + t[-1]:
	print ("Yes")
else:
	print ("No")
# Judge status: Accepted
n = int(input())
dict = {}
max = 1
for i in range(n):
  str = input()
  if str in dict:
    dict[str] = dict[str] + 1
    if dict[str] > max:
      max += 1
  else:
    dict[str] = 1
keys = [k for k, v in dict.items() if v == max]
keys.sort()
for i in range(len(keys)):
  print(keys[i])
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    p, q, r = map(int, input().split())
    m = max([p, q, r])
    if m == p:
        print(q + r)
    elif m == q:
        print(p + r)
    elif m == r:
        print(p + q)

if __name__ == '__main__':
    main()
# Judge status: Accepted
A,B,M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

ans = min(a)+min(b)

for i in range(M):
    c =list(map(int,input().split()))
    s = a[c[0]-1]+b[c[1]-1]-c[2]
    ans = min(s,ans)

print(ans)
# Judge status: Accepted
q,h,s,d=map(int,input().split())
n=int(input())
ans=int(0)
q*=4
h*=2
if n%2==1:
    ans+=min([q,h,s])
    n-=1

n//=2
ans+=n*min([2*q,2*h,2*s,d])
print(int(ans))
# Judge status: Accepted
def resolve():
    x,k,d = map(int,input().split())
    if x < 0:
        x = -x
    if k*d > x:
        g = x//d * d
        if (k - x//d) % 2 == 0:
            print(x - g)
        else:
            print(abs(x-g-d))
    else:
        print(x-k*d)
resolve()
# Judge status: Accepted
d,t,s=map(int,input().split())
print('Yes' if d<=t*s else 'No')
# Judge status: Accepted
#!/usr/bin/env python3
# N = int(input())
# S = input()
A, B, T= map(int, input().split())
# A = list(map(int, input().split()))
i = 0
while (i + 1) * A <= T + 0.5:
    i += 1
print(B * i)
# Judge status: Accepted
import heapq

N, M = map(int, input().split())
jobs = [[] for i in range(M)]

for i in range(N):
    A, B = map(int, input().split())
    if A - 1 < M:
        jobs[A-1].append(B)

q = []
heapq.heapify(q)
ans = 0
for i in range(M):
    for j in jobs[i]:
        heapq.heappush(q, -j)
    if len(q) != 0:
        ans += -heapq.heappop(q)

print(ans)
# Judge status: Accepted
x,k,d = map(int,input().split())

ab = abs(x)//d
ab_1 = ab +1

koho1 = abs(x) - abs(d*ab)
koho2 = abs(abs(x) -abs(d*ab_1))

tmp = k-ab

koho_s = []

if(tmp > 0):
    if(tmp%2 == 0):
        ans = koho1
    else:
        ans = koho2
elif(tmp == 0):
    ans = koho1
else:
    ans = abs(x) - abs(d*k)

print(ans)