peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
X,N=map(int, input().split())
try: 
    p=list(map(int, input().split()))
except:
    print(X)
    exit(0)
if X not in p:
    print(X)
    exit(0)
c=1
while 1:
    if X-c not in p:
        print(X-c)
        exit(0)
    if X+c not in p:
        print(X+c)
        exit(0)
    c+=1
# Judge status: Accepted
n, m = map(int, input().split())
List = list(map(int, input().split()))

if n >= m:
  print(0)
  
else:
  List.sort()
  dis = []
  for i in range(1, len(List)):
    dis.append(List[i] - List[i-1])
  dis.sort()
  res = 0
  for i in range(len(dis)-(n-1)):
    res += dis[i]
  print(res)
# Judge status: Accepted
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

N = int(readline())
A = list(map(int,readline().split()))
from collections import Counter
Ac = Counter(A)
s = sum(A)
Q = int(readline())
for i in range(Q):
    b,c = map(int,readline().split())
    s += (c-b)*Ac[b]
    Ac[c] += Ac[b]
    Ac[b] = 0
    print(s)
# Judge status: Accepted
from collections import defaultdict
dd=defaultdict(int)

N=int(input())
for _ in range(N):
  dd[input()]+=1

M=int(input())
for _ in range(M):
  dd[input()]-=1

ans=max(dd.values())
ans=max(ans, 0)
print(ans)
# Judge status: Wrong Answer
N=int(input())
A=int(input())
if N % 500 <=A:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
N,A,B,C,D=map(int,input().split())
S=input()
for i in range(B-1,D-1):
  if S[i:i+2]=='##':
    print('No')
    exit() 
for i in range(A-1,C-1):
  if S[i:i+2]=='##':
    print('No')
    exit()
if C>D:
  for i in range(B-2,D-1):
    if S[i:i+3]=='...':
      print('Yes')
      exit()
  print('No')
  exit()
print('Yes')
# Judge status: Wrong Answer
s=list(map(int,list(input())))
from collections import Counter
cs=Counter(s)
print(min(cs.values())*2)
# Judge status: Accepted
n = int(input())
a = [0] * (n + 1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            c = x * x + y * y + z * z + x * y + y * z + z * x
            if c <= n:
                a[c] +=1
            else:
                break
for i in a[1:]:
    print(i)
# Judge status: Accepted
L, R = map(int, input().split())

MOD = 2019

res = []
for i in range(L, min(L+MOD, R+1)):
    for j in range(i+1, min(L+MOD, R+1)):
        res.append((i*j) % MOD)
print(min(res))
# Judge status: Wrong Answer
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
res=0
if n>a:
  res+=n//a
  n=a
if n>b:
  res+=n//b
  n=b
if n>c:
  res+=n//c
  n=c
if n>d:
  res+=n//d
  n=d
if n>e:
  res+=n//d
  n=e
print(res+5)
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))

tmp = P[0]
ans = 1
for i in range(1, N):
    if tmp > P[i]:
        tmp = P[i]
        ans += 1
print(ans)
# Judge status: Accepted

def solve(N, heights):
  dp = [float('inf')] * N
  dp[0] = 0
  for i in range(N - 1):
    dp[i + 1] = min(dp[i + 1], dp[i] + abs(heights[i] - heights[i + 1]))
    if i + 2 < N:
      dp[i + 2] = min(dp[i + 2], dp[i] + abs(heights[i] - heights[i + 2]))

  print(dp[N-1])

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

solve(iin(), iln())
# Judge status: Accepted
S = input()
a = "abcdefghijklmnopqrstuvwxyz"
ans = "None"
for x in a:
  if x not in S:
    ans = x
    break
print(ans)
# Judge status: Accepted
N=int(input())
L=list()
L.append(2)
L.append(1)
for i in range(2,N+1):
  L.append(L[i-2]+L[i-1])
print(L[N])
# Judge status: Accepted
def main():
    n = int(input())
    idx = -1
    cnt = -1
    for i in range(1,n+1):
        tmp = (bin(i)[2:])[::-1].find('1')
        if tmp > cnt:
            cnt = tmp
            idx = i
    print(idx)

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import math
a = sorted(list(map(int,input().split())))
print(a[2] - a[1] + math.ceil((a[1] - a[0]) / 2) + (a[1] - a[0]) % 2 == 1)
# Judge status: Accepted
import fractions
C, D, A, B  = map(int,input().split())
num = A * B // fractions.gcd(A, B)
ans = D - C + 1 - D // A + (C - 1) // A - D // B + (C - 1) // B + D // num - (C - 1) // num

print(ans)
# Judge status: Accepted
MOD = 1000000007

X,Y = map(int,input().split())
x,y = (2*X-Y)//3,(2*Y-X)//3#行動１、行動２を起こす回数
if (2*X-Y)%3 != 0 or (2*Y-X)%3 != 0 or x < 0 or y < 0 or(x==0 and y==0):
    print(0)
    exit()
ans =1
for i in range(x+y,0,-1):
    ans = ((ans%MOD)*i)%MOD
for i in range(x,0,-1):
    ans = ((ans%MOD)*pow(i,MOD-2,MOD))%MOD
for i in range(y,0,-1):
    ans = ((ans%MOD)*pow(i,MOD-2,MOD))%MOD

print(ans)
# Judge status: Wrong Answer
import math
n = int(input())
m = math.sqrt(n)
print(int(math.floor(m)))
# Judge status: Accepted
n, x, t = map(int, input().split())
print((n + x - 1) // x * t)
# Judge status: Wrong Answer
N=str(input())

if int(N[-1])==3:
	print("bon")
elif int(N[-1])==0 or 1 or 6 or 8:
	print("pon")
else:
	print("hon")
# Judge status: Accepted
a, b, c, d = [int(_) for _ in input().split()]
print(max(a * c, a * d, b * c, b * d))
# Judge status: Accepted
def gcd(a,b):
    if b==0: return a
    return gcd(b,a%b)

def ela(g):
    s={1}
    i=2
    while i*i<=g:
        while g%i==0:
            g//=i
            s.add(i)
        i+=1
    if g!=1: s.add(g)
    return s

a,b=map(int,input().split())
G=gcd(max(a,b),min(a,b))
print(len(ela(G)))
# Judge status: Accepted
S = input()
White = '10'*(len(S)//2)+'1'*(len(S)%2)
Black = '01'*(len(S)//2)+'0'*(len(S)%2)
WD = len([X for X in map(set,zip(S,White)) if len(X)==2])
BD = len([X for X in map(set,zip(S,Black)) if len(X)==2])
print(min(WD,BD))
# Judge status: Wrong Answer
from functools import lru_cache
import sys 
sys.setrecursionlimit(2147483647)

N = int(input())
A = []
for i in range(0,N):
    A.append(list(map(int,input().split())))


#@lru_cache(None)
def dfs(d,pre):
    if (d,pre) in dic: return dic[(d,pre)]
    if d>=N-1: return 0
    ma = 0 
    for idx,a in enumerate(A[d]):
        if idx != pre:
            res = dfs(d + 1,idx) + a 
            ma = max(res,ma)
    dic[(d,pre)] = ma
    return ma
dic = {}
res = dfs(-1,-1)
print(res)
# Judge status: Accepted
n = int(input())
#a, b = map(int,input().split())
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
sl = []
for i in range(n):
    sl.append(int(input()))

total = sum(sl)
sl.sort()

if total % 10 == 0:
    ans = 0
    for i in range(n):
        if sl[i]%10!=0:
            ans=total-sl[i]
            break
else:
    ans = total
print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
x=max(a*c,b*d)
y=max(a*d,b*c)
print(max(x,y))
# Judge status: Accepted
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    se = input().rstrip()

    S = "S" in se
    N = "N" in se
    E = "E" in se
    W = "W" in se

    if (S ^ N) or (E ^ W):
        print("No")
    else:
        print("Yes")


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
n = int(input())
s = input()
res = ''
abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
for i in range(len(s)):
  res += abc[abc.index(s[i]) + n]
print(res)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

for i in A:
    if i % 2 == 0 and i % 3 != 0 and i % 5 != 0:
        result = 'No'
        break
    else:
        result = 'Yes'

if result == 'No':
    print('DENIED')
else:
    print('APPROVED')
# Judge status: Accepted
N, M = map(int, input().split())
ans = -1
S = [0] * M
C = [0] * M
for i in range(M):
    S[i], C[i] = map(int, input().split())

def check(x):
    if len(str(x)) != N:
        return False
    for s, c in zip(S, C):
        if str(x)[s-1] != str(c):
            return False    
    return True

for i in range(10**N):
    if check(i):
        ans = i
        break

print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())

ans_l = 0
ans_r = n
for _ in range(m):
    l, r = map(int, input().split())
    ans_l = max(ans_l, l)
    ans_r = min(ans_r, r)
print(ans_r-ans_l+1)
# Judge status: Accepted
N,X = map(int,input().split())
l = list(map(int,input().split()))

pos = 0
cnt = 1

for i in range(N):
    pos += l[i]

    if pos <= X:
        cnt += 1
    else:
        break

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

A=['SAT','FRI','TUE','WED','THU','MON','SUN']

print(A.index(S)+1)
# Judge status: Accepted
def main():
    N = int(input())
    A = list(map(int, input().split()))
    d = {}
    r = 0
    for i, v in enumerate(A, start = 1):
        if -i-v in d:
            d[-i-v] += 1
        else:
            d[-i-v] = 1
        if v-i in d:
            r += d[v-i]
    return r
print(main())
# Judge status: Wrong Answer
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if A < B:
  if (V*T + W*T) >= abs(B - A):
      print("YES")
  else:
      print("NO")
elif A > B:
  if (V*T + W*T) >= abs(A - B):
      print("YES")
  else:
      print("NO")
# Judge status: Wrong Answer
c = input()
if c == ('a' or 'b' or 'c' or 'd' or 'e'):
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
a,b,k = map(int,input().split())
cnt = 0
ans = list()
for i in range(1,101):
  if a%i==0 and b%i==0:
    ans.append(i)

print(ans[::-1][k-1])
# Judge status: Accepted
S = input()
print('yes') if len(S) == len(set(S)) else print('no')
# Judge status: Wrong Answer
def main():
    s, = map(int, open(0).read().split())

    first_place_of_s = s % 10

    if first_place_of_s in [2, 4, 5, 7, 9]:
        ans = 'hon'
    elif first_place_of_s in [0, 1, 6, 8]:
        ans = 'pon'
    else:
        ans = 'bon'

    ans = ''
    print(ans)
    return()


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
datalist=list(map(int,input().split()))
N,A,B=datalist[0],datalist[1],datalist[2]
strings=str(input())
na,nb=0,0
for i in range(len(strings)):
  if strings[i]=="a":
    if na + nb < A+B:
      print("YES")
      na += 1
    else:
      print("NO")
  elif strings[i]=="b":
    if na + nb < A+B:
      if nb <= B:
        print("YES")
        nb += 1
      else:
        print("NO")
    else:
      print("NO")
  else:
    print("NO")
# Judge status: Wrong Answer
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    while m > 0:
        idx = 0
        t.sort(reverse=True)
        # print(t)
        t[0] //= 2
        m -= 1
        if m != 0:
            if t[0] > t[1]:
                t[0] //= 2
            else:
                t[1] //= 2
            m -= 1

    print(sum(t))
# Judge status: Accepted
a, b, c = map(int, input().split())
if a+b == c or a+c == b or b+c == a:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = int(input())

s = []
for i in range(n):
    s.append(input())

ans = ""

for i in range(len(s[0])):
    check = 0
    for j in range(1,n):
        if not s[0][i] in s[j]:
            check = 1
    if check == 0:
        ans = ans + s[0][i]

ans = ''.join(sorted(ans))
print(ans)
# Judge status: Wrong Answer
ma=input()
mb=input()
mc=input()
mdic={"a":ma,"b":mb,"c":mc}
m="a"
ndic={"a":0,"b":0,"c":0}
while ndic[m]<len(mdic[m]):
  m=mdic[m][ndic[m]]
  ndic[m]+=1
print(m.upper())
# Judge status: Accepted
x,y=map(int,input().split())

X=abs(x)
Y=abs(y)

if x<y:
    if x*y>0:
        print(abs(X-Y))
    elif x*y==0:
        print(abs(X-Y))
    else:
        print(abs(X-Y)+1)
else:
    if x*y>0:
        print(abs(X-Y)+2)
    elif x*y==0:
        print(abs(X-Y)+1)
    else:
        print(abs(X-Y)+1)
# Judge status: Wrong Answer
N=int(input())
s=set()
for i in range(N):
  a=set(input())
  s^=a
print(len(a))
# Judge status: Wrong Answer
n, d = map(int, input().split())

min = 0
count = 1
while (1):
   max = min + 2 * d + 1
   min = max + 1
   if (max >= n):
      break
   count += 1
print(count)
# Judge status: Wrong Answer
x = int(input())
ans = x//11 * 2
mod = x%11

if mod<=6:
    ans += 1
else:
    ans += 2

print(ans)
# Judge status: Accepted
x = int(input())
ans = 8
if x <= 599:
    ans = 8
elif x <= 799:
    ans = 7
elif x <= 999:
    ans = 6
elif x <= 1199:
    ans = 5
elif x <= 1399:
    ans = 4
elif x <= 1599:
    ans = 3
elif x <= 1799:
    ans = 2
else:
    ans = 1
print(ans)
# Judge status: Accepted
s = input()

A = []
Z = []
for i, si in enumerate(s):
    if si == 'A':
        A.append(i)
    elif si == 'Z':
        Z.append(i)

print(max(Z) - min(A) + 1)
# Judge status: Wrong Answer
N=int(input())
AA=list(map(int,input().split()))
AA=sorted(AA)[::-1]
print(sum(AA)-AA[-1])
# Judge status: Wrong Answer
N=int(input())
a = list(map(int, input().split()))
print(a.count(1))
for i in range(1,N):
    n=a.count(i)
    m=a.count(i+1)
    for x in range(0,n):
        print(m)
    if m==0:
        break
# Judge status: Accepted
from fractions import gcd
a,b,c,d=map(int,input().split())
e=c*d//gcd(c,d)
def num(x,c,d,e):
  return x-x//c-x//d+x//e
print(num(b,c,d,e)-num(a-1,c,d,e))
# Judge status: Accepted
n = input()
s = list(n)
p = 0
for i in range(len(s)):
    s[i] = int(s[i])
    p += s[i]
if p%9 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))

if N==len(A):
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
import numpy

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

lstMain = list()
for i in range(0, N):
    lstMain.append(list(map(int, input().split())))

print(lstMain)

count = 0
for i in range(0, N):
    for j in range(i+1, N):
        y = numpy.array(lstMain[i])
        z = numpy.array(lstMain[j])
        u = z - y
        distance = float(numpy.linalg.norm(u))
        if distance.is_integer():
            count += 1

print(count)
# Judge status: Accepted
h,n=map(int,input().split())
a=sum(map(int,input().split()))
print('Yes' if h<=a else 'No')
# Judge status: Accepted
n = input()
n = n[::-1]
kuriage = 0
sum = 0
for i in range(len(n)):
  intI = int(n[i]) + kuriage
  if intI < 5:
    kuriage = 0
    sum += intI
  elif intI > 5:
    kuriage = 1
    sum += (10 - intI)
  else: # intI == 5
    if len(n) != i+1 and int(n[i+1]) >= 5:
      kuriage = 1
      sum += (10 - intI)
    else:
      kuriage = 0
      sum += intI  
print(sum + kuriage)
# Judge status: Accepted
import sys
N = int(input())
S = input()
unique_S = list(set(list(S)))

sys.exit() if not (2 <= N <= 100) else ''
sys.exit() if len(S) != N else ''
sys.exit() if not S.islower() else ''

result = 0
for I in range(len(S)):
    count = 0
    for J in range(len(unique_S)):
        if ( unique_S[J] in S[0:I] ) and ( unique_S[J] in S[I:] ):
            count += 1
        if result < count:
            result = count

print(result)
# Judge status: Wrong Answer
a=list(input())
for i in range(len(a)):
    if a[i]=="B" and i>=1 and len(a)!=0 :
         a[i-1]=''
         a[i]=''
if a[0]=="B":
    a[0]=''
a=''.join(a)
print(a)
# Judge status: Wrong Answer
D,T,S=map(int,input().split())
 
if S*T>D:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def solve():
    A, B, C, X, Y = map(int, input().split())
    
    ans = 5000 * 2 * 10 ** 5
    for i in range(max(X, Y) + 1):
        ans = min(ans, 2 * i * C + A * max(0, X - i) + B * max(0, Y - i))
    print(ans)


if __name__ == '__main__':
    solve()
# Judge status: Accepted
s = list(input())
t = list(input())
s = sorted(s)
t = sorted(t, reverse=True)
for i in range(min(len(s), len(t))):
  if s[i] > t[i]:
    print("No")
    exit()
  elif s[i] < t[i]:
    print("Yes")
    exit()
else:
  if len(s) < len(t):
    print("Yes")
  else:
    print("No")
# Judge status: Wrong Answer
s = list(input())
t = list(input())
print(s)
print(t)

time = 0
for i in range(len(s)):
    if s[i] != t[i] :
        s[i] = t[i]
        time += 1
 
print(time)
# Judge status: Wrong Answer
def main():
  n, k = map(int, input().split(' '))
  A = list(range(n+2))
  ans = 0
  for i in range(k, n+2):
    print('i', i)
    tmp_min = sum(A[:i])
    tmp_max = sum(A[n+2-i:])
    ans += tmp_max - tmp_min
  print(ans)
    

if __name__ == '__main__':
  main()
# Judge status: Accepted
a,b,c,d = map(int, input().split())
if a <= b <= c <= d or c <= d <= a <= b:
  print(0)
else:
  ar = sorted([a,b,c,d])
  print(ar[2] - ar[1])
# Judge status: Wrong Answer
N, K = map(int,input().split())

H = list(input().split())

H.sort()

sum = 0

for i in range(N-K):
    sum = sum+int(H[i])
    
print(sum)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
m = min(a)
print(sum(a)-m)
# Judge status: Accepted
n, m = map(int, input().split())
l = [list(map(int, input().split())) for i in range(m)]
for i in range(1, n+1):
    cnt = 0
    for j in l:
        cnt += j.count(i)
    print(cnt)
# Judge status: Wrong Answer
N = int(input())
CSF = []
for i in range(N-1):
    csf = list(map(int, input().split()))
    CSF.append(csf)
# print("CSF: {}".format(CSF))

for i in range(N-1):
    ans = 0
    for j in range(i, N-1):
        c, s, f = CSF[j]
        if ans < s:
            ans = s
        ans += c
    print(ans)
print(0)
# Judge status: Accepted
print(['NO','YES'][input()==input()[::-1]])
# Judge status: Accepted
def resolve():

    N=int(input())
    S=[int(input()) for i in range(N)]
    from functools import reduce
    from fractions import gcd

    def lcm(A,B):
        return A* B // gcd(A, B)

    #S=[15,25,30]

    print(reduce(lcm,S))




resolve()
# Judge status: Wrong Answer
x, y, z = map(int, input().split())
print(y, z, x)
# Judge status: Wrong Answer
S = input()
if (int(S[:2]) > 12 and int(S[2:]) > 12) or int(S[:2]) == 0 or int(S[2:]) == 0:
    print("NA")
elif int(S[:2]) > 12:
    print("YYMM")
elif int(S[2:]) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")
# Judge status: Accepted
def main():
  n = int(input())
  a = tuple(map(int ,input().split()))

  ans = [0]*(10**6)
  for x in a:
    ans[x-1] += 1
    ans[x] += 1
    ans[x+1] += 1
  print(max(ans))
if __name__ == '__main__':
  main()
# Judge status: Accepted
data = list(map(int,input().split()))
price = list(map(int,input().split()))

#print(data)
#print(price)

price.sort()

#print(price)

res = 0

for i in range(data[1]):
#    print ( 'i = {}'.format(i))
    res += price[i]

print(res)
# Judge status: Wrong Answer
S = []
for i in range(3):
    tmp = list(input())
    S.append(tmp)
turn = 0
while True:
    if len(S[turn]) == 0:
        print(chr(ord('A')+turn))
        break
    turn = ord(S[turn][0]) - ord('a')
    del S[turn][0]
# Judge status: Wrong Answer
N, K = map(int, input().split())
P = [int(i) for i in input().split()]


s_max = sum(P[:K])
print(s_max)
s = s_max
for i in range(K, N):
    print(P[i], P[i - K])
    s = s + P[i] - P[i - K]
    s_max = max(s_max, s)

print((s_max + K)  / 2)
# Judge status: Accepted
a=int(input())
s=input()
if a >= 3200 :
    print(s)
else :
    print('red')
# Judge status: Accepted
print('YNeos'[len(set(list(input())))!=3::2])
# Judge status: Accepted
x = int(input())
a = x // 11 * 2
b = x % 11

if 0 < b <= 6:
    a += 1
elif b > 6:
    a += 2

print(a)
# Judge status: Accepted
import bisect

n = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))

ans = 0

for b in B:
  i = bisect.bisect_left(A, b)
  j = bisect.bisect_right(C, b)
  ans += i*(n-j)
  
print(ans)
# Judge status: Accepted
## C - Energy Drink Collector
N, M = map(int, input().split())
val = []
for n in range(N):
    val.append( list(map(int, input().split())) )
val = sorted(val, reverse=False, key=lambda x: x[0])
ans = 0
for n in range(N):
    if val[n][1] >= M:
        ans += val[n][0] * M
        break
    else:
        ans += val[n][0] * val[n][1]
        M -= val[n][1]
print(ans)
# Judge status: Accepted
n = int(input())
print(n*(n-1)//2)
# Judge status: Accepted
N = int(input())
S = [input() for i in range(N)]
from collections import Counter
ctr = Counter(S[0])
for s in S[1:]:
    ctr &= Counter(s)
ans = ''
for k,v in sorted(ctr.items()):
    ans += k * v
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())

p = [(x+1)/2 for x in map(int, input().split())]

ans = sum(p[0:k])
prev = ans

for i in range(1, n - k + 1):
    prev = prev - p[i - 1] + p[i + k - 1]
    if ans < prev:
        ans = prev

print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
from functools import reduce
def mod_comb4(n,r,mod=10**9+7):
    num=reduce(lambda x,y:x*y%mod,range(n,n-r,-1))
    den=reduce(lambda x,y:x*y%mod,range(1,r+1))
    return num*pow(den,mod-2,mod)%mod
def main():
    n,a,b=map(int,input().split())
    mod=10**9+7
    print((pow(2,n,mod)-1-mod_comb4(n,a)-mod_comb4(n,b))%mod)

if __name__=='__main__':
    main()
# Judge status: Accepted
l=list(map(int, input().split()))
l.sort()
if l[0]%2==0 or l[1]%2==0 or l[2]%2==0:
  print(0)
else:
  print(l[0]*l[1])
# Judge status: Wrong Answer
n = int(input())
a = ([list(map(int, input().split())) for _ in range(n)])

dp = [[0,0,0] for _ in range(n)]

for i, a in enumerate(a):
  dp_1 = dp[i-1]
  dp[i][0] = max(dp_1[1], dp_1[2]) + a[0]
  dp[i][1] = max(dp_1[0], dp_1[2]) + a[1]
  dp[i][2] = max(dp_1[0], dp_1[1]) + a[2]

print(max(dp[n-1]))
# Judge status: Wrong Answer
N=int(input())
T,A = map(int, input().split(' '))
places=[int(x) for x in input().split()]

diff = abs( A - T - places[-1]*0.006)
num = N

for i in range(N-1):
  if diff > abs( A - T - places[i]*0.006):
    diff = abs( A - T - places[i]*0.006)
    num=i+1

print(num)
# Judge status: Wrong Answer
a=list(map(int,input().split()))
a.sort()
print(a[0]*10+a[1]+a[2])
# Judge status: Wrong Answer
import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
INF = float('inf')


def main():
    N = int(readline())
    alphabet = 'zabcdefghijklmnopqrstuvwxyz'
    A = []
    ans = ''
    while N>0:
        ans = alphabet[N%26] + ans
        N//=26
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
S = [input() for _ in range(N)]
M = int(input())
T = [input() for _ in range(M)]
Get = {}
for s in S:
    if s in Get:
        Get[s] += 1
    else:
        Get[s] = 1
for t in T:
    if t in Get:
        Get[t] += -1
    else:
        Get[t] = -1
ans = max(Get.values())
print(ans if ans > 0 else 0)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import sys

alist = [
  "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
  "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
  "u", "v", "w", "x", "y", "z",
]

for s in sys.stdin:
  i = 0
  for a in alist:
    if s == a:
      print(alist[i+1])
    i += 1
# Judge status: Wrong Answer
a1,a2,a3 = map(int,input().split())

sum = a1 + a1 + a3

if sum >= 22:
	print('bust')
elif sum <= 21:
	print('win')
# Judge status: Wrong Answer
k = int(input())
n = 0
for i in range(1, k+1):
    n = (n * 10 + 7) % k
    if n == 0:
        print(i)
        break
# Judge status: Wrong Answer
N = input()
A = map(int,(input().split()))

output = 'APPROVED'

for n in A:
    if (n % 2 == 0) and (n % 6 != 0) or (n % 10 != 0):
        output = 'DENIED'
        
print(output)
# Judge status: Accepted
a,b,c = map(int,input().split())
if a - b >= c:
     print(0)
else:
     print(c - a + b)
# Judge status: Accepted
o = input()
e = input()
for i in range(len(e)):
    print(o[i] + e[i], end="")
if len(o) > len(e):
    print(o[-1], end="")
print()
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
if N==2:
    print(*A)
else:
    A=sorted(A)
    ans1=A[-1]
    del A[-1]
    saidai=ans1/2
    num=pow(10,9)
    for n in range(N-1):
        if abs(saidai-A[n])<num:
            num=abs(saidai-A[n])
        else:
            ans2=n-1
    print(ans1,A[ans2])
# Judge status: Accepted
#!/usr/bin/env python3

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

min_, max_ = 0, 10**5
for i in range(m):
    a, b = list(map(int, input().split()))

    min_ = max(min_, a)
    max_ = min(max_, b)

print(max(max_-min_+1, 0))
# Judge status: Accepted
n = int(input())
a = int(input())
if n % 500 > a:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
import sys
import numpy as np
 
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
 
k,x=map(int,input().split())

if k*500>=x:
	print("Yes")
else:
	print("No")