peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n=int(input())
a,b=[list(map(int,input().split())) for i in range(2)]
if sum(a) >sum(b):print("No")
elif sum(a)==sum(b):

    for x,c in zip(a,b):
        if x!=c:print("No");exit()
    print("Yes")
else:
    cnt=sum(b)-sum(a)
    v=cnt
    for x,y in zip(a,b):
        if x>=y:v-=(x-y)
        else:
            v-=(x+y)%2
            cnt-=(y-x+(x+y)%2)//2
    print("Yes") if cnt*2==v and cnt>=0 and v>=0 else print("No")
# Judge status: Accepted
n = int(input())
s = input()

if n%2 == 1:
  print('No')
elif s[:n//2]==s[n//2:]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
S = ""
if N == 0:
  S = "0"
c = 1
while N != 0:
  if N%(2**c) != 0:
    N -= (-2)**(c-1)
    S = "1" + S
  else:
    S = "0" + S
  c += 1  
print(S)
# Judge status: Accepted
n,k = map(int,input().split())
lst = list(map(int,input().split()))
e,o = 0,0
for i in range(n):
    if lst[i]%2==0:
        e += 1
    else:
        o += 1

if o==0:
    if k==0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
tmp = 0
c = 0
ls = [100]
for i in range(k):
    tmp += a[i]
ls[0] = tmp
for i in range(n-k):
    tmp -= a[i]
    tmp += a[i+k]
    if ls[0] >= tmp:
        print("No")
    else:
        print("Yes")
    ls[0] = tmp
    #print(ls,tmp)
# Judge status: Wrong Answer
x, n = map(int, input().split())
p = list(map(int, input().split()))

def main():
    if len(p) == 0:
        print(x)
        return

    ans_l = list(range(x-15, x+15))

    diff_l = list(set(p) ^ set(ans_l))
    diff_l.sort()

    cnt = 100
    ans = 100
    for i in range(0, len(diff_l)):
        check = abs(diff_l[i]-x)
        if check < cnt:
            cnt = check
            ans = diff_l[i]
    print(ans)
    return

main()
# Judge status: Accepted
a,b=map(int,input().split())
if a>b:
    print(str(b)*a)
else:
    print(str(a)*b)
# Judge status: Accepted
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
c=[0]*(n+1)
for i in a:
    c[i]+=1
print(sum(sorted(c)[:-k]))
# Judge status: Accepted
from collections import Counter


def main():
    n = input()
    a = [int(v) for v in input().split()]
    count = dict(Counter(a))
    q = int(input())

    ans = 0
    for k, v in count.items():
        ans += k*v

    for i in range(q):
        b, c = map(int, input().split())
        ans = ans - count.get(b, 0) * b + count.get(b, 0) * c
        print(ans)
        count[c] = count.get(c, 0) + count.get(b, 0)
        count[b] = 0


if __name__ == '__main__':
    main()
# Judge status: Accepted
a=list(map(int,input().split()))
a.sort()
count=1
for i in range(2):
    if a[i]!=a[i+1]:
        count+=1
print(count)
# Judge status: Accepted
import math
N = int(input())
a = 1
b = N
sqrt = math.floor(N ** (1/2))
for n in range(sqrt, 0, -1):
    if N % n == 0:
        a = n
        b = N // n
        break
    
print(a + b - 2)
# Judge status: Accepted
s = input()
print(min([abs(753-int(s[i:i+3])) for i in range(len(s)-2)]))
# Judge status: Accepted
N = int(input())
S = input()
if S[:N//2] == S[N//2:]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted

def resolve():
    a, b, c = list(map( int, input().split() ))
    print("YES" if b-a == c-b else "NO")
    


if '__main__' == __name__:
    resolve()
# Judge status: Accepted
a=int(input())
if a%2==0:
    print(a//2)
else:
    print((a//2)+1)
# Judge status: Accepted
N, C, K = map(int, input().split())
Tlist = sorted([int(input()) for _ in range(N)])
ans = 0
now = 1
start = Tlist[0]
for t in Tlist[1:]:
    if now == C:
        ans += 1
        start = t
        now = 1
    else:
        if t - start <= K:
            now += 1
        else:
            ans += 1
            start = t
            now = 1
print(ans+1)
# Judge status: Accepted
x, y = map(int, input().split())
print(len(bin(y//x)[2:]))
# Judge status: Accepted
n = int(input())
a, b = [list(map(int, input().split())) for i in range(2)]

ap = bp = 0
for i in range(n):
        if a[i]>b[i]: bp += a[i]-b[i]
        else:
                if (b[i]-a[i])%2: bp += 1
                ap += (b[i]-a[i]+1)//2
print("YNeos"[ap<bp::2])
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
aa = []
bb = []
for _ in range(n):
    a, b = map(int, readline().split())
    aa.append(a)
    bb.append(b)
aa.sort()
bb.sort(reverse=True)
if n == 2:
    print(bb[0] - aa[0] + 1)
else:
    print(bb[1] - aa[1] + 1)
# Judge status: Accepted
S = input()
s = len(S)
ct = 0
for i in range(s):
    if S[i] != S[(-i-1)]:
        ct += 1 
print(ct//2)
# Judge status: Wrong Answer
s = input()
for i in set(s):
    if s.count(i) % 2 == 1:
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
n, m = map(int, input().split())
AB = [None] * n
maxa = 0
for i in range(n):
    AB[i] = tuple(map(int, input().split()))
    if AB[i][0] > maxa:
        maxa = AB[i][0]
AB.sort(key=lambda ab: -ab[1])
cands = [b for _, b in AB[:m - maxa]]
AB = AB[m - maxa:]
counts = [0] * m
for a, b in AB[:maxa]:
    if a <= m and sum(counts[a - 1:]) <= m - a:
        cands.append(b)
        counts[a - 1] += 1
print(sum(cands[:m]))
# Judge status: Accepted
from math import floor

def main():
    a, b, n = map(int, input().split())

    x = b - 1
    if x > n:
        x = n

    print(floor(a*x/b))

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

if a>b and b!=1 or a==1:
    print("Alice")
elif a==b:
    print("Draw")
else:
    print("Bob")
# Judge status: Accepted
n = int(input())
print((n * (n-1)) // 2)
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n*2>=m:
  print(m//2)
else:
  ((n*2+m)//4)
# Judge status: Accepted
n,k = map(int,input().split())
s = list(input())

if s[k-1] == "A":
	s[k-1] = "a"
elif s[k-1] == "B":
	s[k-1] = "b"
else:
	s[k-1] = "c"

print("".join(s))
# Judge status: Accepted
import collections as c
n,k = map(int,input().split())
x = list(map(int,input().split()))
y = c.Counter(x)
s = []
for i in y.items():
    s.append([i[1],i[0]])
s.sort()
ans = 0
for i in range(len(s)-k):
    ans += s[i][0]
print(ans)
# Judge status: Accepted
n = int(input())

for i in range(1,10):
  r = n/i
  if 1 <= r <= 9 and r == int(r):
    print("Yes")
    exit()
    
print("No")
# Judge status: Accepted
S = input()

n = S.count('N')
w = S.count('W')
s = S.count('S')
e = S.count('E')

def f(n,s):
  return (n==0 and s==0) or (n>0 and s>0)

b = f(n,s) and f(e,w)

if b:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

prefix = [0]
for a in A:
    prefix.append(prefix[-1] + a)

res = 0
M = 10 ** 9 + 7
for i, a in enumerate(A[:-1], start=1):
    res += a * (prefix[N] - prefix[i])
    res %= M
print(res)
# Judge status: Wrong Answer
sx,sy,tx,ty = map(int,input().split())
dx = tx-sx
dy = ty-sy

print("R"*dx+"U"*dy+"R"+"D"*(dy+1)+"L"*(dx+1) +"U"\
    +"U"*dy+"R"*dx+"U"+"L"*(dy+1)+"D"*(dx+1) +"R" )
# Judge status: Wrong Answer
x = int(input())

s , a = divmod(x , 11)

if a > 6:
    print((s*2) + 2)
else:
    print((s*2) + 1)
# Judge status: Accepted
import fractions
from functools import reduce

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

left = [0] * (N+1)
right = [0] * (N+1)

for i in range(N):
    left[i+1] = fractions.gcd(left[i], a[i])
    right[N-i-1] = fractions.gcd(right[N-i], a[N-1-i])

ans = 0
for i in range(N):
    ans = max(ans, fractions.gcd(left[i], right[i+1]))

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
dic = {}
for i in range(N):
    if A[i] in dic:dic[A[i]] += 1
    else:dic[A[i]] = 1
# print(dic)
num = 1
n = 0
if not dic.get(0):num = 0
else:
    while 1:
        num *= dic[n]**dic[n+1]
        dic.pop(n)
        n += 1
        if not dic.get(n+1):
            dic.pop(n)
            if dic.keys():
                num = 0
            break
print(num)
# Judge status: Accepted
s = int(input())
moto = s
count = 0
while s!=1:
  if s%2==0:
    s /= 2
  else:
    s = s*3+1
  count += 1
if moto == 1:
  print(4)
elif moto == 2:
  print(4)
else:
  print(count+2)
# Judge status: Wrong Answer
a,b = map(int,input().split())
#最大公約数
def gcd(a,b):#a<=b
    while b != 0:
        a = b
        b = b % a
    return a
#最小公約数
def lcm(a,b):
    return a*b / gcd(a,b)

print(lcm(a,b))
# Judge status: Accepted
q,h,s,d = map(int,input().split())
#20 30 70 90
N = int(input())
#3


o = min(q*4,h*2,s)

if o*2 <= d:
	print(o*N)
else:
	print(d*(N//2) + o*(N%2))
# Judge status: Accepted
n, m, q = map(int, input().split())
abcd = [tuple(map(int, input().split())) for _ in range(q)]

import itertools
cr = itertools.combinations_with_replacement(range(1, m+1), n)
M = 0
for seq in cr:
  score = sum([d for a, b, c, d in abcd if seq[b-1] - seq[a-1] == c])
  M = max(M, score)
print(M)
# Judge status: Accepted
a, b, c = map(int, input().split())
k = a-b
vv = c - k
if vv >= 0:
  print(vv)
else:
  print(0)
# Judge status: Accepted
N, T = map(int, input().split())
cost = []
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost.append(c)

cost.sort()
if len(cost) == 0:
    print('TLE')
else:
    print(cost[0])
# Judge status: Wrong Answer
N,K=map(int,input().split())
ans=0
for k in range(K,N+2):
  ans+= (k*(2*N+1-k)//2) - (k*(k-1)//2) +1
print(ans)
# Judge status: Wrong Answer
n, k = map(int, input().split())
a_ls = list(map(int, input().split()))

my_dict = dict()

ptr = 0
cnt = 0

while True:
    if ptr in my_dict:
        break
    else:
        my_dict[ptr] = cnt
        cnt += 1
        ptr = a_ls[ptr] - 1

loop = cnt - my_dict[ptr]

k = k % loop + loop * (10 ** 6 // loop)

ptr = 0

for i in range(k):
    ptr = a_ls[ptr] - 1

print(ptr + 1)
# Judge status: Accepted
import sys
input = sys.stdin.readline
from collections import Counter

N=int(input())
A=Counter(list(map(int,input().split())))
x=[0,0]
for a in A:
    if A[a]>1:x.append(a)
    if A[a]>3:x.append(a)
x.sort()
print(x[-1]*x[-2])
# Judge status: Accepted
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0

for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i + 100*j + 50*k == X:
                count += 1

print(count)
# Judge status: Wrong Answer
N = int(input())
nums = list(map(int, input().split()))
S = sum(nums)
print(S)
half = 0
for num in nums:
  half += num
  if half*2 >= S:
    answer = min(half-S//2, S//2-half+num)
    if S%2 != 0:
      answer += 1
    print(answer)
    exit()
# Judge status: Accepted
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, D = MAP()
print(-(-N//(2*D+1)))
# Judge status: Wrong Answer
s = input()
t = input()
s_split = list(s)
s_split.sort()
t_split = list(t)
t_split.sort()

if len(s_split) < len(t_split):
    if s_split <= t_split:
        print("Yes")
    else:
        print("No")
else:
    if s_split < t_split:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

ans = 0
a.sort(reverse = True)
for i in range(1, 2 * N, 2):
  ans += a[i]

print(ans)
# Judge status: Accepted
# https://atcoder.jp/contests/abc058/tasks/abc058_a

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

if (b - a) == (c - b):
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
for i in range(N):
    if A[i]>i:
        print(-1)
        exit()
# Judge status: Wrong Answer
import itertools
n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
nums = list(range(1,n+1))
d= [ list(i) for i in itertools.permutations(nums,n)]
a=0
b=0
for i in range(len(d)):
  if p==d[i]:
    a=i
  elif q==d[i]:
    b=i
print(abs(a-b))
# Judge status: Wrong Answer
n,a,b=map(int, input().split())
pot = b-a+1
if(b<a):
    print(0)
    exit()
if n==0:
    print(0)
elif n==1:
    if a==b:
        print(1)
    else:print(0)
elif n==2:
    if a==b:print(1)
    print(1)
else:
    k = n-2
    ans=(pot*(pot+1))//2
    pot -= k
    ans-=(pot*(pot+1))//2


    print(ans)
# Judge status: Wrong Answer
A = int(input("Input a value for 'a': "))
FINAL = A + (A*A) + (A*A*A)
print(FINAL)
# Judge status: Accepted
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())

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

li.sort()

for i in range(N-1):
  li[i+1] = (li[i] + li[i+1])/2
  
print(li[N-1])
# Judge status: Wrong Answer
import math
def main():
  n = int(input())
  s = input()
  ans=0
  for i in range(0,int(n/2)+1):
    sum=0
    x=s[:i+1]
    y=s[i+1:]
    while len(x)>0:
      if x[0] in y :
        sum+=1
      x=x.replace(x[0],'')
    if sum>ans:
      ans=sum
  print(ans)
main()
# Judge status: Accepted
w=input()
d={}
for c in w:
    if c in d:
        d[c]+=1
    else:
        d[c]=1
for k in d:
    if d[k]%2!=0:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
n, l = (int(xi) for xi in input().split())

a = int(n*(l-1)+n*(n+1)/2)

# print(a)
if 0<1-l<n+1: print(a)
if 1-l<1: print(a-(l+1-1))
if n<1-l: print(a-(l+n-1))
# Judge status: Accepted
N, M = map(int, input().split())

ans = 0
if N * 2 <= M:
    ans += N
    M -= N * 2
    ans += M // 4
    print(ans)
else:
    ans += M//2
    print(ans)
# Judge status: Wrong Answer
n=int(input())
A=[0]*n
for i in range(n):
  A[i]=int(input())
  
s=0
m=0
for i in range(n):
  s+=A[i]//2
  if A[i]%2==0:
    m=0
  else:
    if m==1:
      s+=1
      m=0
print(s)
# Judge status: Wrong Answer
from collections import Counter

S = input()
num = len(S)

data = [0]*100

for i in range(100):
    data[i] = 2019 * (1 + i)

ans = 0


for i in range(100):
    tar = str(data[i])
    if (tar in S):
        tarNum = len(str(tar))
        for j in range(num - tarNum + 1):
            cut = S[j: j + tarNum]
 #           print(cut)
            if (cut == tar):
                ans += 1

print(ans)
# Judge status: Accepted
N=int(input())
ans=0
for i in range(1,N+1):
    if i%3==0 or i%5==0:
        continue
    ans+=i
print(ans)
# Judge status: Wrong Answer
a, b, c, d = map(int,(input().split()))

if a - (b + c) <= d:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
strN = str(N)

if strN.count("7") > 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
ll=[]
for i in range(n):
    ll.append([int(i) for i in input().split()])
dp=[[0]*3 for i in range(n)]
dp[0]=ll[0]
for i in range(1,n):
    for j in range(3):
        dp[i][j]=max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3])+ll[i][j]
print(max(dp[n-1]))
# Judge status: Accepted
nums = [int(e) for e in input().split()]
count=0
for i in range(nums[1]):
    if (nums[0]*(i+1))%nums[1]==nums[2]:
        count=1
if count==0:
    print("NO")

else:
    print("YES")
# Judge status: Accepted
from sys import stdin,stdout
M=10**9+7
n=int(stdin.readline())
# a,b,c,d=list(map(int,stdin.readline().split()))
# pp=int(pow(10,n-2))
# ans=(pp*n*(n-1))
ans=(10**n)-2*(9**n)+(8**n)
print(ans%M)
# Judge status: Accepted
s = list(input())
t = list(input())
s.sort()
s2 = ''.join(s)
t.sort(reverse=True)
t2=''.join(t)
print('Yes') if s2<t2 else print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())
c = max(a, b)
d = min(a, b)
ans = str(c)*d
print(ans)
# Judge status: Wrong Answer
A, B = map(int, input().split())
Ax = A * 25 / 2
Ay = (A + 1) * 25 / 2
Bx = B * 10
By = (B + 1) * 10

if Ay <= Bx or By <= Ax:
    print(-1)
else:
    ans = max(Bx, Ax)
    if ans % 1:
        ans = int(ans)
        ans += 1
    print(ans)
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
t = 0
for i,b in enumerate(B):
    m = min(A[i], b)
    b -= m
    A[i] -= m
    t += m
    m = min(A[i+1], b)
    b -= m
    A[i+1] -= m
    t += m
print(t)
# Judge status: Wrong Answer
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
P = inintl()

ans = 0

for i in range(n-1):
    if i+1 == P[i] and i+2 == P[i+1]:
        ans += 1
    elif i+1 != P[i] and i+2 == P[i+1]:
        ans += 1
    elif i+1 == P[i] and i+2 != P[i+1]:
        continue

if P[0] == 1 and P[1] != 2:
    ans += 1

print(ans)
# Judge status: Wrong Answer
s,t = input().split()

print(s + t)
# Judge status: Accepted
n, m = map(int, input().split())

l = [0]*n

for i in range(m):
    a, b = map(int, input().split())
    l[a-1] +=1
    l[b-1] +=1

for i in range(n):
    print(l[i])
# Judge status: Accepted
inp=[1,1]
v=pow(10,9)+7
for i in range(2,2001):
  inp.append((inp[-1]*i)%v)
s=int(input())
up=s//3
ans=0
for k in range(1,up+1):
  a=inp[s-2*k-1]
  b=inp[k-1]*inp[s-3*k]
  b=pow(b,v-2,v)
  ans+=((a*b)%v)
  ans=ans%v
print (ans)
# Judge status: Accepted
# author:  Taichicchi
# created: 12.09.2020 19:26:19

import sys

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

S = input()

cum_ls = [0]

for i in range(1, N):
    if S[i - 1: i + 1] == "AC":
        cum_ls.append(cum_ls[i - 1] + 1)
    else:
        cum_ls.append(cum_ls[i - 1])

# print(cum_ls)

for i in range(Q):
    l, r = map(int, input().split())
    print(cum_ls[r - 1] - cum_ls[l - 1])
# Judge status: Accepted
n,d = map(int,input().split())

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

c=0
D2=[]
for i in range(n-1):
    for j in range(i+1,n):
        d2=0.0
        for k in range(d):
            d2 += (X[i][k]-X[j][k])**2
        D2.append(d2**0.5)
        if (d2**0.5)%1==0 :
            c+=1
print(c)
# Judge status: Wrong Answer
import math

n = int(input())
count = 0
flg = True

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

for i in range(2, int(math.sqrt(n)) + 1):

    if n % i == 0:
        n = n // i
        flg = False
        count += 1

if flg == True:
    print(1)
    exit()

print(count)
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())

tx_sx = tx - sx
ty_sy = ty - sy


ans = ""
for i in range(ty_sy):
    ans += "U"

for i in range(tx_sx):
    ans += "R"


for i in range(ty_sy):
    ans += "D"

for i in range(tx_sx):
    ans += "L"

ans += "L"

for i in range(ty_sy + 1):
    ans += "U"

for i in range(tx_sx + 1):
    ans += "R"
ans += "DR"

for i in range(ty_sy + 1):
    ans += "D"

for i in range(tx_sx + 1):
    ans += "L"

ans += "U"
print(ans)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int,input().split()))
s = sorted(p)
for i in range(n//2):
    if p[i] < p[n-1-i]:
        #print(p[i],p[n-1-i])
        pass
    else:
        a = p[i]
        b = p[n-1-i]
        p[i] = b
        p[n-1-i] = a
    
#print(p)
#print(s)
if p == s:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()
 
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
    if a[i] == 1:
        break
left = len(a[:i])
right = len(a[i + 1:])

ans = left // (k - 1) + right//(k - 1) + (left%(k-1) + right%(k-1))//(k-1) + int((left%(k-1) + right%(k-1))%(k - 1) != 0)

print(ans)
# Judge status: Accepted
x=input()
ans=["YES","NO"][x not in "357"]
print(ans)
# Judge status: Accepted
# ans = 全通り - nCa - nCb
#     = 2^n - 1 - nCa - nCb
def comb(n,r,mod=10**9+7):
    a=1
    b=1
    r = min(r,n-r)
    for i in range(r):
        a = a*(n-i)%mod
        b = b*(i+1)%mod
    return a*pow(b,mod-2,mod)%mod

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

mod = (10**9) + 7

num_all = pow(2, n, mod) - 1
nca = comb(n, a, mod=mod)
ncb = comb(n, b, mod=mod)

ans = num_all - nca - ncb
ans %= mod

print(ans)
# Judge status: Accepted
X,Y = map(int, input().split())

ans = 0
num = X
while num <= Y:
    ans += 1
    num *= 2

print(ans)
# Judge status: Wrong Answer
n = int(input())
d = [0 for i in range(n)]
for i in range(n):
    a = 0
    for j in input():
        a += 2**(ord(j)-97)
    d[i] = a
d = sorted(d)
ans = 0
co = 1
for i in range(1, n):
    if d[i-1] == d[i]:
        co += 1
    else:
        ans += co*(co-1) // 2
        co = 1
ans += co*(co-1) // 2
print(ans)
# Judge status: Wrong Answer
def ABC106C(n):
    a = 0
    for i in range(1,n+1):
        if n % i == 0:
            a += 1
    return a

a = 0
for i in range(1,int(input()),2):
    if ABC106C(i)==8:
        a += 1
print(a)
# Judge status: Accepted
n,m=map(int,input().split())
if n==1 and m==1:
    print(1)
elif n==1 or m==1:
    print(max(n-2,m-2))
else:
    print((n-2)*(m-2))
# Judge status: Accepted
n=int(input())
s=[]
t=[0]*101
for _ in range(n):
    si=input()
    if si not in s:s.append(si)
    t[s.index(si)]+=1
m=int(input())
for _ in range(m):
    si=input()
    if si in s:t[s.index(si)]-=1
print(max(0,max(t)))
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
s=[]
for i in range(101):
  for j in range(0,len(a)):
    m=0
    m+=(a[j]-i)**2
    s.append(m)
print(min(s))
# Judge status: Accepted
S=input()
K=int(input())

i=0
l=''
while i<len(S)-1:
    if S[i]=='a':
        l+='a'
    elif 123-ord(S[i])<=K:
        l+='a'
        K-=123-ord(S[i])
    else:
        l+=S[i]
    i+=1

if K>0:
    K%=26
    n=ord(S[-1])+K
    if n>122:
        n-=26
    l+=chr(n)
else:
    l+=S[-1]


print(l)
# Judge status: Accepted
word=list(input())
for i in range(len(word)):
    word[i]="x"
print("".join(word))
print()
# Judge status: Accepted
N,T=map(int,input().split())
List = []
for i in range (N):
  List.append(list(map(int, input().split())))
res = 1001
for i in range(N):
  if List[i][1] <= T:
    res = min(res,List[i][0])
if res == 1001:
  print("TLE")
else:
  print(res)
# Judge status: Wrong Answer
from collections import Counter
n, k = map(int, input().split())
a = list(map(int, input().split()))
syurui = len(set(a))
#print(syurui)
c = Counter(a)
ans = 0
c_sort = c.most_common()
print(c_sort)
for i in range(1, syurui-k + 1):
    ans += c_sort[-i][1]
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))
B = [1]
C = [1] + [0] * (N - 1)
i = 0

while C[A[i] - 1] == 0:
    B.append(A[i])
    C[A[i] - 1] = 1
    i = A[i] - 1

ans = 0
for j in range(len(B)):
    if B[j] == A[i]:
        ans += j

if len(B) - ans != 0:
    ans += (K - ans) % (len(B) - ans)

print(B[ans])
# Judge status: Accepted
import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(4100000)

INF = 1 << 60

n = int(input())
h = list(map(int, input().split()))
dp = [INF] * n
dp[0] = 0
for i in range(1, n):
    dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))
    if i != 1:
        dp[i] = min(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))
    # print(dp[i], h[i], h[i - 1], h[i - 2])
# for i in dp:
#     print(i)
print(dp[-1])
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
s_lst=[0]
for i,aa in enumerate(a):
  s_lst.append(s_lst[i]+aa) # len(s_lst): n+1
s_all=s_lst[-1]
ans=float("inf")
for i in range(1,len(s_lst)-1):
  ans=min(ans,abs(2*s_lst[i]-s_all))
print(ans)
# Judge status: Accepted
x,y = map(int, input().split())


print(x*y)
# Judge status: Accepted
x = int(input())

i = 2
ans = 1
while i * i < x:
    j = 2
    while i**j <= x:
        ans = max(ans, i**j)
        j += 1
    i += 1
print(ans)
# Judge status: Accepted
K = int(input())
S = input()
 
if len(S) <= K:
    print(S)
else:
    print(S[0:K] + '...')