Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():

  # a〜z
  l=['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']

  l2=[list() for i in range(26)]
  l3=[list() for i in range(26)]

  s=S()
  t=S()

  for i in range(len(s)):
    l2[l.index(s[i])].append(t[i])
    l3[l.index(t[i])].append(s[i])

  for x in l2:
    for y in x:
      if x.count(y)!=len(x):
        return 'No'

  for x in l3:
    for y in x:
      if x.count(y)!=len(x):
        return 'No'

  return 'Yes'

print(main())


### FIXED CODE ###

dict={
  'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25,
}
l1=['']*26
l2=['']*26
s1=input()
s2=input()
f=0
for i in range(len(s1)):
  a=s1[i]
  b=s2[i]
  ind=dict[a]
  if l1[ind]=='':
    l1[ind]=b
  else:
    if l1[ind]!=b:
      f=1
      break
  ind=dict[b]
  if l2[ind]=='':
    l2[ind]=a
  else:
    if l2[ind]!=a:
      f=1
      break
if f==1:
  print('No')
else:
  print('Yes')
### BUGGY CODE ###

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    unique_s = []
    cnt_s = []
    for i in range(n):
        if s[i] not in unique_s:
            unique_s.append(s[i])
            cnt_s.append(1)
        else:
            for j in range(len(unique_s)):
                if s[i] == unique_s[j]:
                    cnt_s[j] += 1
                    break

    max_cnt_s = max(cnt_s)
    top_list = []
    for i in range(len(cnt_s)):
        if cnt_s[i] == max_cnt_s:
            top_list.append(unique_s[i])

    top_list.sort()

    for i in range(len(top_list)):
        print(top_list[i])

### FIXED CODE ###

from collections import Counter

if __name__=="__main__":
    n = int(input())
    s=[]
    for i in range(n):
        s.append(input())
        
    s_most = Counter(s).most_common()

    ans_list = [s_most[0][0]]
    for i in range(1,len(s_most)):
        if s_most[i][1]==s_most[0][1]:
            ans_list.append(s_most[i][0])
        else:
            break

    ans_list.sort()

    for i in range(len(ans_list)):
        print(ans_list[i])
### BUGGY CODE ###

count = 0
while True:
    try:
        s_lis1 = list(raw_input())
        s_lis2 = s_lis1[:]
        s_lis2.reverse()
        if s_lis1 == s_lis2:
            count += 1
    except EOFError:
        print count

### FIXED CODE ###

count = 0
while True:
    try:
        s_lis1 = list(raw_input())
        s_lis2 = s_lis1[:]
        s_lis2.reverse()
        if s_lis1 == s_lis2:
            count += 1
    except EOFError:
        print count
        break
### BUGGY CODE ###

H,W = map(int,input().split())
S = []
height, width_max, ans = [0] * (W+1), [0] * (W+1), 0
for i in range(H):
    s = list(input()) + [0]
    length = 0
    for j in range(W+1):
        if s[j] == '.':
            length += 1
            height[j] += 1
        else:
            if length > 0:
                for k in range(j-length, j):
                    if width_max[k] < length:
                        width_max[k] = length
                s = s[:(j-length)] + [length]*length + s[j:]
                length = 0
            if height[j] > 0:
                temp = width_max[j] + height[j] - 1
                if ans < temp:
                    ans = temp
                height[j] = 0 
    S.append(s)

for j in range(W):
    if height[j] > 0:
        temp = width_max[j] + height[j] - 1
        if ans < temp:
            ans = temp
        height[j] = 0 

print(ans)


### FIXED CODE ###

H,W = map(int,input().split())
height, width_max, ans = [0] * (W+1), [0] * (W+1), 0
for i in range(H):
    s = input() + '#'
    length = 0
    for j in range(W+1):
        if s[j] == '.':
            length += 1
            height[j] += 1
        else:
            if length > 0:
                for k in range(j-length, j):
                    if width_max[k] < length:
                        width_max[k] = length
                length = 0
            if height[j] > 0:
                temp = width_max[j] + height[j] - 1
                if ans < temp:
                    ans = temp
                width_max[j], height[j] = 0, 0
for j in range(W):
    if height[j] > 0:
        temp = width_max[j] + height[j] - 1
        if ans < temp:
            ans = temp
print(ans)
### BUGGY CODE ###

L , R = map(int,input().split())
if R - L >= 2019 or L == 0:
    print("0")
min = 2020
for i in range(L , R):
    for j in range(i + 1 , R + 1):
        tmp_min = ( i * j) % 2019
        if tmp_min < min:
            min = tmp_min
print(min)

### FIXED CODE ###

L , R = map(int,input().split())
if R - L >= 2019 or L == 0:
    print("0")
    exit()
min = 2020

for i in range(L , R):
    for j in range(i + 1 , R + 1):
        tmp_min = ( i * j) % 2019
        if tmp_min < min:
            min = tmp_min
print(min)
### BUGGY CODE ###

li = [i for i in range(1, int(input())+ 1)]
print(sum(li[:-1]))

### FIXED CODE ###

n = int(input())
print((n * (n - 1)) // 2)
### BUGGY CODE ###

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

def main():
    N = int(input())
    S = input()
    ans = 0
    RGB = []
    for i in range(N):
        RGB.append(Counter(S[:i+1]))
        
    for i in range(N-1):
        for j in range(i+1, N):
            if S[i] == S[j]:
                continue
            c = 'RGB'.replace(S[i], '')
            c = c.replace(S[j], '')
            ans += RGB[-1][c] - RGB[j][c]
            if 2*j - i < N and S[2*j-i] == c:
                ans -= 1
    print(ans)

main()

### FIXED CODE ###

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

def main():
    N = int(input())
    S = input()
    ans = 0
    r, g, b = [0 for _ in range(N+1)], [0 for _ in range(N+1)], [0 for _ in range(N+1)]
    for i in range(N):
        r[i+1], g[i+1], b[i+1] = r[i], g[i], b[i]
        if S[i] == "R":
            r[i+1] += 1
        elif S[i] == "G":
            g[i+1] += 1
        else:
            b[i+1] += 1
    
    for i in range(1, N-1):
        if S[i] == "R":
            ans += g[i] * (b[N] - b[i+1]) + b[i] * (g[N] - g[i+1])
            for j in range(1, min(i, N-i-1)+1):
                if {S[i-j], S[i+j]} == {"G", "B"}:
                    ans -= 1
        
        elif S[i] == "G":
            ans += r[i] * (b[N] - b[i+1]) + b[i] * (r[N] - r[i+1])
            for j in range(1, min(i, N-i-1)+1):
                if {S[i-j], S[i+j]} == {"R", "B"}:
                    ans -= 1
        elif S[i] == "B":
            ans += g[i] * (r[N] - r[i+1]) + r[i] * (g[N] - g[i+1])
            for j in range(1, min(i, N-i-1)+1):
                if {S[i-j], S[i+j]} == {"G", "R"}:
                    ans -= 1
    print(ans)

main()
### BUGGY CODE ###

import collections

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

x = []  
for _ in range(M):
  L,R = map(int,input().split())
  x.extend(list(range(L,R+1)))
    
c = collections.Counter(x)

print(len([i[0] for i in c.items() if i[1] == M]))

### FIXED CODE ###

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

L = []
R = []
for _ in range(M):
  x,y = map(int,input().split())
  L.append(x)
  R.append(y)

if min(R) >= max(L):
  print(min(R)-max(L)+1)
else:
  print(0)
### BUGGY CODE ###

n, t = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

ab.sort()

dp = [[0] * t for _ in range(n + 1)]

ans = 0
for i, (a, b) in enumerate(ab):
    for j in range(t):
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])
        if j + a <= t - 1:
            dp[i+1][j+a] = max(dp[i+1][j+a], dp[i][j] + b)
        else:
            ans = max(ans, dp[i][j] + b)

print(ans)


### FIXED CODE ###

n, t = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

ab.sort()

dp = [[0] * t for _ in range(n + 1)]

ans = 0
for i, (a, b) in enumerate(ab):
    for j in range(t):
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])
        if j + a <= t - 1:
            dp[i+1][j+a] = max(dp[i+1][j+a], dp[i][j] + b)
        else:
            ans = max(ans, dp[i][j] + b)

print(ans)
### BUGGY CODE ###

s = input()
s = s[1:len(s)-1]

arr = s.split("LR")
arr = ["R"+i+"L" for i in arr]
solution_array = []

for i in arr:
    l = len(i)
    count = 1
    for j in range(l):
        if i[j] == "L":
            count = j
            break
    if count%2 != 0:        
        rcount = l - l//2
        lcount = l//2
    else:
        rcount = l//2
        lcount = l - l//2
    tmparray = [0]*l
    tmparray[count-1] = rcount
    tmparray[count] = lcount
    solution_array = solution_array + tmparray
    
t = str(solution_array[0])
for i in range(len(s)+1):
    t = t +" " + str(solution_array[i+1])

print(t)

### FIXED CODE ###

s = input()
l = len(s)

arr = [1]*l

for i in range(l-2):
    if s[i] == "R":
        if s[i+1] == "R":
            arr[i+2] += arr[i]
            arr[i] = 0
        
for i in range(l-1,1,-1):
    if s[i] == "L":
        if s[i-1] == "L":
            arr[i-2] += arr[i]
            arr[i] = 0
        
print(*arr)
### BUGGY CODE ###

import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
ans = int(0)

N, M = LI()
S = LI()
T = LI()
dp = [[0]*(M+1) for _ in range(N+1)]
sumdp = [[0]*(M+1) for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,M+1):
        if S[i-1]==T[j-1]:
            dp[i][j] = sumdp[i-1][j-1]+1
            sumdp[i][j] = sumdp[i - 1][j] + sumdp[i][j - 1] +1
#            sumdp[i][j] = sumdp[i-1][j] + sumdp[i][j-1] - sumdp[i-1][j-1] + dp[i][j]
        #累積和の更新
        else:
            sumdp[i][j] = sumdp[i-1][j] + sumdp[i][j-1] - sumdp[i-1][j-1]
#        sumdp[i][j] %=mod
#        ans += dp[i][j]
#print(dp)
#for row in dp:
#    ans+= sum(row)%mod
print((sumdp[N][M]+1)%mod)

### FIXED CODE ###

import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
ans = int(0)

N, M = LI()
S = LI()
T = LI()
dp = [[0]*(M+1) for _ in range(N+1)]
sumdp = [[0]*(M+1) for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,M+1):
        if S[i-1]==T[j-1]:
            dp[i][j] = sumdp[i-1][j-1]+1
            sumdp[i][j] = sumdp[i - 1][j] + sumdp[i][j - 1] +1
#            sumdp[i][j] = sumdp[i-1][j] + sumdp[i][j-1] - sumdp[i-1][j-1] + dp[i][j]
        #累積和の更新
        else:
            sumdp[i][j] = sumdp[i-1][j] + sumdp[i][j-1] - sumdp[i-1][j-1]
        sumdp[i][j] %=mod
#        ans += dp[i][j]
#print(dp)
#for row in dp:
#    ans+= sum(row)%mod
print((sumdp[N][M]+1)%mod)
### BUGGY CODE ###

q = int(input())

for k in range(q):
    x = list(input())
    y = list(input())
    lcs = [0 for i in range(len(x)+1)] 
    for i in range(1,len(y) + 1):
        lcs_2 = [i for i in lcs]
        
        for j in range(1,len(x) + 1):
            if x[j-1] != y[i-1]:
                lcs[j] = max(lcs[j-1],lcs_2[j])
            else:
                lcs[j] = lcs_2[j-1] + 1
    print(lcs[len(x)])

### FIXED CODE ###

q = int(input())
 
def lcss(x,y):
     
    lcs = [0]*(len(x)+1)
    for i in range(len(y)):
        w1 = y[i]
        lcs_2 = lcs[:]
        for j in range(len(x)):
            if x[j] == w1:
                lcs[j+1] = lcs_2[j] + 1  
            elif lcs[j+1] < lcs[j]:
                lcs[j+1] = lcs[j]
    return lcs[-1]
 
for i in range(q):
    x = input()
    y = input()
    print(lcss(x,y))
### BUGGY CODE ###

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

x = [[0 for j in range(N + 1)] for i in range(N + 1)]
c = [[0 for j in range(N + 1)] for i in range(N + 1)]

for _ in range(M):
    L, R = map(int, input().split())
    x[L][R] += 1

for i in range(1, N + 1):
    for j in range(1, N + 1):
        x[i][j] += x[i][j - 1]

for _ in range(Q):
    p, q = map(int, input().split())
    print(sum(x[i][q] - x[i][p - 1] for i in range(p, q + 1)))


### FIXED CODE ###

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

x = [[0 for j in range(N + 1)] for i in range(N + 1)]

for _ in range(M):
    L, R = map(int, input().split())
    x[N - L][R] += 1

for i in range(1, N + 1):
    for j in range(1, N + 1):
        x[i][j] += x[i][j - 1]

for j in range(1, N + 1):
    for i in range(1, N + 1):
        x[i][j] += x[i - 1][j]

for _ in range(Q):
    p, q = map(int, input().split())
    print(x[N - p][q])
### BUGGY CODE ###

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
result = 0

for i in range(2**n):
    list_v = []
    list_c = []
    for j in range(n):
        if (i >> j) &1 ==1:
            list_v.append(v[j])
            list_c.append(c[j])
    if sum(list_v) - sum(list_c) >= result:
        result = sum(list_v) - sum(list_c)

print(result)

### FIXED CODE ###

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
result = 0

for i in range(2**n):
    list_v = []
    list_c = []
    for j in range(n):
        if (i >> j) &1 ==1:
            list_v.append(v[j])
            list_c.append(c[j])
    if sum(list_v) - sum(list_c) >= result:
        result = sum(list_v) - sum(list_c)

print(result)
### BUGGY CODE ###

K,S = map(int,input().split())
x,y,z = 0,0,0
n = 0

for i in range(K+1):
    x = i
    for j in range(K+1):
        y = j
        for k in range(K+1):
            z = k
            if x+y+z == S:
                n += 1

print(n)


### FIXED CODE ###

K,S = map(int,input().split())
x,y,z = 0,0,0
n = 0

for i in range(K+1):
    x = i
    for j in range(K+1):
        y = j
        z = S-(x+y)
        if 0 <= z <=K:
            n += 1

print(n)
### BUGGY CODE ###

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

arr = []
for i in range(m):
    c = input().split()
    arr.append([(int)(c[0]), c[1]])
#print("{}".format(arr))

penalty_log = {}    # まだACでないWAはここに溜める
success_log = []    # 一度でも成功したACはここに溜める

for elem in arr:
    if elem[1] == 'WA':
        if elem[0] not in success_log:
            if elem[0] not in penalty_log:
                penalty_log[elem[0]] = 1
            else:
                penalty_log[elem[0]] += 1

    elif elem[1] == 'AC':
        if elem[0] not in success_log:
            success_log.append(elem[0])

#print("success_log = {}".format(success_log))
#print("penalty_log = {}".format(penalty_log))

success = len(success_log) # ACの個数
penalty = 0 # WAの個数
for k, v in penalty_log.items():
    if k in success_log:
        penalty += v
print("{} {}".format(success, penalty))

### FIXED CODE ###

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

arr = []
for i in range(m):
    c = input().split()
    arr.append([(int)(c[0]), c[1]])
#print("{}".format(arr))

penalty_log = {}    # まだACでないWAはここに溜める
success_log = set([])    # 一度でも成功したACはここに溜める

for elem in arr:
    if elem[1] == 'WA':
        if elem[0] not in success_log:
            if elem[0] not in penalty_log:
                penalty_log[elem[0]] = 1
            else:
                penalty_log[elem[0]] += 1

    elif elem[1] == 'AC':
        if elem[0] not in success_log:
            success_log.add(elem[0])

#print("success_log = {}".format(success_log))
#print("penalty_log = {}".format(penalty_log))

success = len(success_log) # ACの個数
penalty = 0 # WAの個数
for k, v in penalty_log.items():
    if k in success_log:
        penalty += v
print("{} {}".format(success, penalty))
### BUGGY CODE ###

n753 = set()
for i in range(357, 77777753+1):
    s = str(i)
    if "1" in s:
        continue
    if "2" in s:
        continue
    if "4" in s:
        continue
    if "6" in s:
        continue
    if "8" in s:
        continue
    if "9" in s:
        continue
    if "3" not in s:
        continue
    if "5" not in s:
        continue
    if "7" not in s:
        continue
    n753.add(i)


N = int(input())

print(len([1 for n in n753 if n <= N]))


### FIXED CODE ###

N = int(input())


def dfs(s):
    if int(s) > N:
        return 0
    if all(s.count(c) > 0 for c in '753'):
        ret = 1
    else:
        ret = 0
    for c in '753':
        ret += dfs(s + c)
    return ret


print(dfs('0'))
### BUGGY CODE ###

while 1:
    n = int(raw_input())
    if n == 0:
        break
    dp = [[0] * n for i in range(n)]
    r = 0
    for i in range(n):
        for j, ch in enumerate(raw_input()):
            if ch == '*':
                continue
            dp[i][j] = 1
            if i >= 1 or j >= 1:
                for k in range(1, dp[i - 1][j - 1] + 1):
                    if dp[i - k][j] == 0 or dp[i][j - k] == 0:
                        break
                    dp[i][j] += 1
            r = max(r, dp[i][j])
    print r

### FIXED CODE ###

while 1:
    n = int(raw_input())
    if n == 0:
        break
    dp = [[0] * n for i in range(n)]
    r = 0
    for i in range(n):
        for j, ch in enumerate(raw_input()):
            if ch == '*':
                continue
            dp[i][j] = 1
            if i >= 1 or j >= 1:
                dp[i][j] += min(dp[i - 1][j - 1], dp[i - 1][j], dp[i][j - 1])
            r = max(r, dp[i][j])
    print r
### BUGGY CODE ###

import sys 
sys.setrecursionlimit(10**9)
N = int(input())
G = [[] for _ in range(N)]
mod = 10**9+7
for _ in range(N-1):
    A, B = map(int, input().split())
    G[A-1].append(B-1)
    G[B-1].append(A-1)
cnt = [[] for _ in range(N)]
que = [0]
depth = [-1]*N
depth[0] = 0
while que:
    v = que.pop()
    d = depth[v]
    for nv in G[v]:
        if depth[nv]>=0:
            continue
        depth[nv] = d+1
        que.append(nv)
d_to_i = [[] for _ in range(N)]
for i in range(N):
    d_to_i[depth[i]].append(i)
for d in range(N)[::-1]:
    for v in d_to_i[d]:
        for nv in G[v]:
            if depth[nv]<depth[v]:
                continue
            if cnt[nv]:
                cnt[v].append(sum(cnt[nv])+1)
            else:
                cnt[v].append(1)
for i in range(N):
    res = N-1
    for j in cnt[i]:
        res-=j
    cnt[i].append(res)
ans = 0
for v in range(N):
    if len(cnt[v])<=1:
        continue    
    res = pow(2, N-1, mod)-1
    for a in cnt[v]:
        res-=pow(2, a, mod)-1
    ans+=res
    ans%=mod
inv = pow(2, (mod-2)*N, mod)
print(ans*inv%mod)







### FIXED CODE ###

import sys 
sys.setrecursionlimit(10**9)
N = int(input())
G = [[] for _ in range(N)]
mod = 10**9+7
for _ in range(N-1):
    A, B = map(int, input().split())
    G[A-1].append(B-1)
    G[B-1].append(A-1)
cnt = [[] for _ in range(N)]
que = [0]
depth = [-1]*N
depth[0] = 0
while que:
    v = que.pop()
    d = depth[v]
    for nv in G[v]:
        if depth[nv]>=0:
            continue
        depth[nv] = d+1
        que.append(nv)
d_to_i = [[] for _ in range(N)]
for i in range(N):
    d_to_i[depth[i]].append(i)
for d in range(N)[::-1]:
    for v in d_to_i[d]:
        for nv in G[v]:
            if depth[nv]<depth[v]:
                continue
            if cnt[nv]:
                cnt[v].append(sum(cnt[nv])+1)
            else:
                cnt[v].append(1)
for i in range(N):
    res = N-1
    for j in cnt[i]:
        res-=j
    cnt[i].append(res)
ans = 0
p = [1]*N
for i in range(1, N):
    p[i] = p[i-1]*2%mod
for v in range(N):
    if len(cnt[v])<=1:
        continue    
    res = p[N-1]-1
    for a in cnt[v]:
        res-=p[a]-1
    ans+=res
    ans%=mod
inv = pow(2, (mod-2)*N, mod)
print(ans*inv%mod)
### BUGGY CODE ###

def main():  
  import sys
  input = sys.stdin.readline
  from collections import deque
  n,m,s,t = [int(i) for i in input().split()]
  es = deque([])
  der = deque([])
  for i in range(m):
    u,v,a,b = [int(i) for i in input().split()]
    es.append((u-1,v-1,a))
    es.append((v-1,u-1,a))
    der.append((u-1,v-1,b))
    der.append((v-1,u-1,b))

  es = tuple(es)
  der = tuple(der)
  def shortest_path(S,n,w,es): 
    d = [10**15] * n #d[i] : s→iの最短距離
    d[S] = 0
    while True:
      update = False
      for p,q,r in es: # e: 辺iについて [from,to,cost]
        if d[p] != 10**15 and d[q] > d[p] + r:
          d[q] = d[p] + r
          update = True       
      if not update:
        break
    return d

  chk = [0]*(n+1)
  ES = tuple(shortest_path(s-1,n,m*2,es))
  DER = tuple(shortest_path(t-1,n,m*2,der))
  for i in range(n-1,-1,-1):
    chk[i] = max(chk[i+1],10**15-ES[i]-DER[i])

  chk = tuple(chk)
  for i in range(n):
    print(chk[i])
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import deque
n,m,s,t = map(int,input().split())
egg = [[] for i in range(n)]
es = [[] for i in range(n)]
for i in range(m):
  u,v,a,b = map(int,input().split())
  es[u-1].append([a,v-1])
  es[v-1].append([a,u-1]) 
  egg[u-1].append([b,v-1])
  egg[v-1].append([b,u-1]) 

es = tuple(es)
egg = tuple(egg)

import heapq
def dijkstra_heap(s,edge):
    #始点sから各頂点への最短距離
    d = [10**18] * n
    used = [True] * n #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        d[v] = minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+d[v],e[1]])
    return d

ES = dijkstra_heap(s-1,es)
EDGE = dijkstra_heap(t-1,egg)
cost = 0
chk = [0]*n
for i in range(n-1,-1,-1):
  cost = max(cost,10**15-ES[i]-EDGE[i])
  chk[i] = cost
chk = tuple(chk)
print(*chk, sep="\n")
### BUGGY CODE ###

sum_num = 1
for i in range(1, int(input()) + 1):
    sum_num *= (i % (10**9 + 7))
print(sum_num % (10**9 + 7))

### FIXED CODE ###

sum_num = 1
for i in range(1, int(input()) + 1):
    sum_num = (sum_num * i) % (10**9 + 7)
print(sum_num)
### BUGGY CODE ###

def framod(n, mod, a=1):
    for i in range(1, n + 1):
        a = a * i % mod
    return a


def power(n, r, mod):
    if r == 0:
        return 1
    if r % 2 == 0:
        return power(n * n % mod, r // 2, mod) % mod
    if r % 2 == 1:
        return n * power(n, r - 1, mod) % mod


def cmb(n, k, mod=10**9+7):
    a = framod(n, mod)
    b = framod(k, mod)
    c = framod(n - k, mod)
    return (a * power(b, mod - 2, mod) * power(c, mod - 2, mod)) % mod


def modpow(n, m, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (modpow(n, m, p//2)**2) % m
    return (modpow(n, m, p-1)*n) % m


def resolve():
    n, a, b = map(int, input().split())
    mod = 10 ** 9 + 7
    n %= mod
    ans = modpow(2, mod, n) - 1
    ans -= cmb(n, a)
    ans -= cmb(n, b)
    print(ans)


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

def comb(a, b, p=10 ** 9 + 7):
    if (b > a - b):
        return comb(a, a - b, p)
    c = d = 1
    for i in range(b):
        c *= (a - i)
        d *= (b - i)
        c %= p
        d %= p
    return c * modpow(d, p - 2, p) % p


def modpow(n, p, m=10 ** 9 + 7):
    if p == 0:
        return 1
    if p % 2 == 0:
        return (modpow(n, p // 2, m) ** 2) % m
    return (modpow(n, p - 1, m) * n) % m


def resolve():
    n, a, b = map(int, input().split())
    mod = 10 ** 9 + 7
    ans = modpow(2, n) - 1
    ans -= comb(n, a)
    ans -= comb(n, b)
    print(ans % mod)


if __name__ == '__main__':
    resolve()