Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
scop = [] #高低差,min値
scom = []
scomn = []
ssum = 0

for i in range(n):
    s = input()
    sa = 0
    ms = 0
    for i in range(len(s)):
        if s[i] == "(":
            sa += 1
        else:
            sa -= 1
        if ms > sa:
            ms = sa
    if sa > 0:
        scop.append([ms,sa])
    elif sa == ms:
        scomn.append([ms,sa])
    else:
        scom.append([ms,sa])
    ssum += sa

if not ssum == 0:
    print("No")
    exit()

scop.sort(reverse = True)
scom.sort()

now = 0
for i in scop:
    if now + i[0] < 0:
        print("No")
        exit()
    else:
        now += i[1]
for i in scom:
    if now + i[0] < 0:
        print("No")
        exit()
    else:
        now += i[1]

print("Yes")


Fixed submission:
n = int(input())
scop = [] #高低差,min値
scom = []
ssum = 0

for i in range(n):
    s = input()
    sa = 0
    ms = 0
    for i in s:
        if i == "(":
            sa += 1
        else:
            sa -= 1
        if ms > sa:
            ms = sa
    if sa > 0:
        scop.append([ms,sa])
    elif not sa == ms:
        scom.append([ms,sa])
    ssum += sa

if not ssum == 0:
    print("No")
    exit()

scop.sort(reverse = True)
scom.sort()

now = 0
for i in scop:
    if now + i[0] < 0:
        print("No")
        exit()
    now += i[1]
for i in scom:
    if now + i[0] < 0:
        print("No")
        exit()
    now += i[1]

print("Yes")
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
s = input()
if s == "ABC"
    print("ARC")
else:
    print("ABC")

Fixed submission:
import numpy as np
import math
s = input()
if s == "ABC":
    print("ARC")
else:
    print("ABC")
Buggy python submission (verdict: Runtime Error):
import numpy as np
import math
n, m, q = map(int,input().split())
max = 0
j = []
for i in range(q):
    aa,b,c,d = map(int,input().split())
    j.append([aa,b,c,d])

a = [0 for k in range(11)]
for i1 in range(1,11):
    a[1] = i1
    for i2 in range(i1,11):
        a[2] = i2
        for i3 in range(i2,11):
            a[3] = i3
            for i4 in range(i3,11):
                a[4] = i4
                for i5 in range(i4,11):
                    a[5] = i5
                    for i6 in range(i5,11):
                        a[6] = i6
                        for i7 in range(i6,11):
                            a[7] = i7
                                for i8 in range(i7,11):
                                a[8] = i8
                                    for i9 in range(i8,11):
                                    a[9] = i9
                                        for i10 in range(i9,11):
                                        a[10] = i10
                                        s = 0
                                        for i in j:
                                            if a[i[1]]-a[i[0]] = i[2]:
                                                s += i[3]
                                        if max < s:
                                            max = s

print(max)



Fixed submission:
import numpy as np
import math
n, m, q = map(int,input().split())
max = 0
j = []
for i in range(q):
    aa,b,c,d = map(int,input().split())
    j.append([aa,b,c,d])

a = [0 for k in range(11)]
for i1 in range(1,11):
    a[1] = i1
    for i2 in range(i1,m+1):
        a[2] = i2
        for i3 in range(i2,m+1):
            a[3] = i3
            for i4 in range(i3,m+1):
                a[4] = i4
                for i5 in range(i4,m+1):
                    a[5] = i5
                    for i6 in range(i5,m+1):
                        a[6] = i6
                        for i7 in range(i6,m+1):
                            a[7] = i7
                            for i8 in range(i7,m+1):
                                a[8] = i8
                                for i9 in range(i8,m+1):
                                    a[9] = i9
                                    for i10 in range(i9,m+1):
                                        a[10] = i10
                                        s = 0
                                        for i in j:
                                            if a[i[1]]-a[i[0]] == i[2]:
                                                s += i[3]
                                        if max < s:
                                            max = s

print(max)
Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())

if n%2 == 1:
    for i in range(m):
        print(n//2-i,n//2+i+1)
else:
    ni = 1
    while ni < n//4 and ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1
    r -= 1
    while ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1


Fixed submission:
n, m = map(int,input().split())

if n%2 == 1:
    for i in range(m):
        print(n//2-i,n//2+i+1)
else:
    ni = 1
    l = 1
    r = n
    while ni <= n//4 and ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1
    r -= 1
    while ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1

Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())

if n%2 == 1:
    for i in range(m):
        print(n//2-i,n//2+i+1)
else:
    ni =1
    while ni < n//4 and ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1
    r -= 1
    while ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1


Fixed submission:
n, m = map(int,input().split())

if n%2 == 1:
    for i in range(m):
        print(n//2-i,n//2+i+1)
else:
    ni = 1
    l = 1
    r = n
    while ni <= n//4 and ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1
    r -= 1
    while ni <= m:
        print(l,r)
        l += 1
        r -= 1
        ni += 1
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import math
n = int(input())
a = []
for i in range(n):
    s = str(input())
    if not s in a:
        a.append(s)
print(len(a))


Fixed submission:
import numpy as np
import math
n = int(input())
d = dict()
for i in range(n):
    s = str(input())
    if s in d:
        continue
    else:
        d[s] = 1
print(len(d))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = np.array(input().split())
buka = [0 for i in range(n)]

for i in a:
    buka[i] += 1

for i in buka:
    print(i)


Fixed submission:
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)
buka = [0 for i in range(n)]

for i in a:
    buka[i-1] += 1

for i in buka:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
n = int(input())
a = list(map(int,input().split()))
hq = []
for i, ai in enumerate(a):
    heapq.heappush(hq,(-ai,i))

dp = [[-1 for i in range(n+1)] for j in range(n+1)]
dp[0][0] = 0
ai,hi = heapq.heappop(hq)
dp[1][0] = -ai*hi
dp[0][1] = -ai*(n-1-hi)
for i in range(2,n+1):
    ai,hi = heapq.heappop(hq)
    dp[i][0] = dp[i-1][0] - ai*abs(hi-i+1)
    dp[0][i] = dp[0][i-1] - ai*abs(n-i-hi)
    for j in range(1,i):
        dp[i-j][j] = max(dp[i-j-1][j]-ai*abs(hi-i+j+1),dp[i-j][j-1]-ai*abs(n-j-hi))

max = 0
for i in range(n+1):
    if max < dp[i][n-i]:
        max = dp[i][n-i]
print(max)


Fixed submission:
import heapq
import time
st = time.time()
n = int(input())
a = list(map(int,input().split()))
hq = []
for i, ai in enumerate(a):
    heapq.heappush(hq,(-ai,i))
dp = [[0 for i in range(j+1)] for j in range(n+1)]
dp[0][0] = 0
ai,hi = heapq.heappop(hq)
dp[1][0] = -ai*(n-1-hi)
dp[1][1] = -ai*hi
for i in range(2,n+1):
    ai,hi = heapq.heappop(hq)
    dp[i][0] = dp[i-1][0] - ai*abs(n-i-hi)
    dp[i][i] = dp[i-1][i-1] - ai*abs(hi-i+1)
    for j in range(1,i):
        dp[i][j] = max(dp[i-1][j-1]-ai*abs(hi-j+1),dp[i-1][j]-ai*abs(n-i+j-hi))

print(max(dp[n]))
Buggy python submission (verdict: Runtime Error):
n = input()
if not n[0] == 7 and n[1] == 7 and n[2] == 7:
    print(No)
else:
    print(Yes)

Fixed submission:
n = str(input())
if n[0] == "7" or n[1] == "7" or n[2] == "7":
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
sum = 0

for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if s[i] == s[j] or s[j] == s[k] or s[k] == s[i] or k-j == j-i:
                continue
            else:
                sum += 1

print(sum)


Fixed submission:
n = int(input())
s = input()
sum = 0
r = 0
g = 0
b = 0

for i in range(n):
    if s[i] == "R":
        r += 1
    elif s[i] == "G":
        g += 1
    else:
        b += 1
sum += r*g*b

for i in range(n):
    wi = (n-i+1)//2
    for w in range(1,wi):
        if s[i] == s[i+w] or s[i+w] == s[i+2*w] or s[i] == s[i+2*w]:
            continue
        else:
            sum -= 1

print(sum)
Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input())
print(z,x,y)

Fixed submission:
x,y,z = map(int,input().split())
print(z,x,y)
Buggy python submission (verdict: Runtime Error):
import queue
k = int(input)
q = queue.Queue()

for i in range(1,10):
    q.put(i)

for i in range(k):
    x = q.get()
    if not x%10 == 0:
        q.put(10*x+(x%10)-1)
    q.put(10*x+(x%10))
    if not x%10 == 9:
        q.put(10*x+(x%10)+1)

print(x)


Fixed submission:
import queue
k = int(input())
q = queue.Queue()

for i in range(1,10):
    q.put(i)

for i in range(k):
    x = q.get()
    if not x%10 == 0:
        q.put(10*x+(x%10)-1)
    q.put(10*x+(x%10))
    if not x%10 == 9:
        q.put(10*x+(x%10)+1)

print(x)
Buggy python submission (verdict: Runtime Error):
n,k,c = map(int,input().split())
s = input()
fro = []
bac = []

for i in range(n):
    if s[i] == "o" and (len(fro) == 0 or fro[-1]+c < i):
        fro.append(i)
    if s[n-i-1] == "o" and (len(bac) == 0 or bac[-1]-c > n-i):
        bac.append(n-i-1)

for i in range(k):
    if fro[i] == bac[-i-1]:
        print(fro[i]+1)


Fixed submission:
n,k,c = map(int,input().split())
s = input()
fro = []
bac = []

for i in range(n):
    if s[i] == "o" and (len(fro) == 0 or fro[-1]+c < i):
        fro.append(i)
    if s[n-i-1] == "o" and (len(bac) == 0 or bac[-1]-c > n-i-1):
        bac.append(n-i-1)

for i in range(k):
    if fro[i] == bac[k-i-1]:
        print(fro[i]+1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(n):
    for j in range(i+1,n):
        num[min([j-i,int(math.fabs(j-y+1))+1+int(math.fabs(i-x+1))])] += 1

for i in range(1,n):
    print(num[i])


Fixed submission:
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(1,n+1):
    for j in range(i+1,n+1):
        ban = min([j-i,abs(x-i)+1+abs(y-j)])
        num[ban] += 1

for i in range(1,n):
    print(num[i])

Buggy python submission (verdict: Runtime Error):
import math
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(n):
    for j in range(i+1,n):
        num[min([j-i,math.fabs(j-y)+1+math.fabs(i-x)])] += 1

for i in range(n):
    print(num[i])


Fixed submission:
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(1,n+1):
    for j in range(i+1,n+1):
        ban = min([j-i,abs(x-i)+1+abs(y-j)])
        num[ban] += 1

for i in range(1,n):
    print(num[i])

Buggy python submission (verdict: Runtime Error):
import math
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(n):
    for j in range(i+1,n):
        num[min([j-i,math.fabs(j-y)+1+math.fabs(i-x)] += 1

for i in range(n):
    print(num[i])


Fixed submission:
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(1,n+1):
    for j in range(i+1,n+1):
        ban = min([j-i,abs(x-i)+1+abs(y-j)])
        num[ban] += 1

for i in range(1,n):
    print(num[i])

Buggy python submission (verdict: Runtime Error):
import math
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(n):
    for j in range(i+1,n):
        num[min([j-i,math.fabs(j-y)+1+math.fabs(i-x))] += 1

for i in range(n):
    print(num[i])


Fixed submission:
n, x, y = map(int,input().split())
num = [0 for i in range(n)]

for i in range(1,n+1):
    for j in range(i+1,n+1):
        ban = min([j-i,abs(x-i)+1+abs(y-j)])
        num[ban] += 1

for i in range(1,n):
    print(num[i])
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)
sum = 0

kn = [0 for i in range(n)]
for i in range(n):
    kn[a[i]] += 1
for i in range(n):
    sum += kn[i]*(kn[i]-1)//2

for i in range(n):
    x = kn[a[i]]
    print(sum-x+1)


Fixed submission:
import numpy as np
n = int(input())
a = np.array(input().split(),dtype=int)
sum = 0

kn = [0 for i in range(n+1)]
for i in range(n):
    kn[a[i]] += 1
for i in range(n+1):
    sum += kn[i]*(kn[i]-1)//2

for i in range(n):
    x = kn[a[i]]
    print(sum-x+1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,s = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    mod = 998244353
    ans = 0
    for i in range(n):
        dp = np.zeros(s+1,dtype=int)
        dp[0] = 1
        for j in range(i,n):
            aj = a[j]
            dpp = dp*1
            dpp[aj:] += dp[:-aj]
            dpp %= mod
            dp = dpp
            ans = (ans+dp[s]*(n-j))%mod
            dp[s] = 0
    print(ans)
    return

if __name__ == '__main__':
    main()


Fixed submission:
import math
import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,s = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]
    mod = 998244353
    ans = 0
    dp = np.zeros(s+1,dtype=int)
    for j in range(n):
        dp[0] += 1
        aj = a[j]
        ndp = dp*1
        if s >= aj:
            dp[s-aj] *= (n-j)
        ndp[aj:] += dp[:-aj]
        ndp %= mod
        dp = ndp
    ans = (ans+dp[s]*(n-j))%mod
    print(ans)
    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int,input().split())
print((n//(a+b))*a+min([a,n%(a+b)]))


Fixed submission:
s = input()
if "A" in s and "B" in s:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int,input().split())
e = 10**-7
mi = max(math.ceil(a*12.5),b*10)
ma = min(int((a-1)+*12.5),b*10-1)
if mi > ma:
    print(-1)
else:
    print(mi)


Fixed submission:
import math
a, b = map(int,input().split())
e = 10**-7
mi = max(math.ceil(a*12.5),b*10)
ma = min(int(math.ceil((a+1)*12.5)-1),(b+1)*10-1)
if mi > ma:
    print(-1)
else:
    print(mi)
Buggy python submission (verdict: Runtime Error):
import numpy as np
s = input()
q = int(input())
rbef = []
aft = []
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            rbef.append(qi[2])
        else:
            aft.append(qi[2])


bef = ''.join(list(reversed(rbef)))
ans = (''.join(reversed(rbef))+s).join(aft)

if sgn == 1:
    print(ans)
else:
    rans = ''.join(list(reversed(ans)))
    print(rans)


Fixed submission:
import numpy as np
s = input()
q = int(input())
rbef = []
aft = []
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            rbef.append(qi[2])
        else:
            aft.append(qi[2])

bef = "".join(reversed(rbef))
taft = "".join(aft)
ans = bef + s + taft

if sgn == 1:
    print(ans)
else:
    rans = ''.join(list(reversed(ans)))
    print(rans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
s = input()
q = int(input())
rbef = str()
aft = str()
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            rbef += qi[2]
        else:
            aft += qi[2]

bef = ''.join(list(reversed(rbef)))
ans = bef+s+aft

if sgn == 1:
    print(ans)
else:
    rans = ''.join(list(reversed(ans)))
    print(rans)


Fixed submission:
import numpy as np
s = input()
q = int(input())
rbef = []
aft = []
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            rbef.append(qi[2])
        else:
            aft.append(qi[2])

bef = "".join(reversed(rbef))
taft = "".join(aft)
ans = bef + s + taft

if sgn == 1:
    print(ans)
else:
    rans = ''.join(list(reversed(ans)))
    print(rans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
s = input()
q = int(input())
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            s = qi[2] + s
        else:
            s = s + qi[2]

if sgn == 1:
    print(s)
else:
    news = ''.join(list(reversed(s)))
    print(news)


Fixed submission:
import numpy as np
s = input()
q = int(input())
rbef = []
aft = []
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            rbef.append(qi[2])
        else:
            aft.append(qi[2])

bef = "".join(reversed(rbef))
taft = "".join(aft)
ans = bef + s + taft

if sgn == 1:
    print(ans)
else:
    rans = ''.join(list(reversed(ans)))
    print(rans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int,input().split())

for i in range(n):
    ans += "x"

pf = True
for i in range(m):
    s,c = map(int,input().split())
    if (not ans[s] == "x") and (not ans[s] == str(c)):
        print(-1)
        pf = False
        break
    else:
        ans[s] = str(c)

if pf:
    if ans[0] == "x":
        ans[0] = "1"
    for i in range(n):
        if ans[i] == "x":
            ans[i] = "0"
print(ans)


Fixed submission:
n, m = map(int,input().split())

ans = [-1 for i in range(n)]

pf = True
for i in range(m):
    s,c = map(int,input().split())
    if ((not ans[s-1] == -1) and (not ans[s-1] == c)) or ((not n == 1)and s == 1 and c == 0):
        print(-1)
        pf = False
        break
    else:
        ans[s-1] = c

if pf and n == 1:
    if ans[0] == -1:
        print(0)
    else:
        print(ans[0])
elif pf:
    if ans[0] == -1:
        ans[0] = 1
    for i in range(n):
        if ans[i] == -1:
            ans[i] = 0
    print(''.join(map(str,ans)))
Buggy python submission (verdict: Runtime Error):
n, k = map(int,input().split())
know = 1
for i in range(n):
    if (n+0.5)//know == 0:
        print(i)
        break
    else:
        know *= k


Fixed submission:
n, r = map(int,input().split())
if n < 10:
    print(r+100*(10-n))
else:
    print(r)
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int,input().split())
mod = 10**9+7

def rev(x):
    re = 10**9+5
    num = 1
    ix = x
    while re > 0:
        if re%2 == 1:
            num = (num*ix)%mod
        re //= 2
        ix = (ix**2)%mod
    return(num)

def kaijo(x):
    num = 1
    for i in range(1,x+1):
        num = (num*i)%mod
    return(num)

re = n
ans = 1
i2 = 2
while re > 0:
    if re%2 == 1:
        ans = (ans*i2)%mod
    re //= 2
    i2 = (i2**2)%mod

ans -= 1
kn = kaijo(n)
ans = (ans - (((kn*rev(kaijo(a)))%mod)*rev(kaijo[n-a]))%mod)%mod
ans = (ans - (((kn*rev(kaijo(b)))%mod)*rev(kaijo[n-b]))%mod)%mod
print(ans)


Fixed submission:
n, a, b = map(int,input().split())
mod = 10**9+7

def rev(x):
    re = 10**9+5
    num = 1
    ix = x
    while re > 0:
        if re%2 == 1:
            num = (num*ix)%mod
        re //= 2
        ix = (ix**2)%mod
    return(num)

def kaijo(x):
    num = 1
    for i in range(1,x+1):
        num = (num*i)%mod
    return(num)

re = n
ans = 1
i2 = 2
while re > 0:
    if re%2 == 1:
        ans = (ans*i2)%mod
    re //= 2
    i2 = (i2**2)%mod
nca = 1
ncb = 1
for i in range(a):
    nca = (nca*(n-i))%mod
for i in range(b):
    ncb = (ncb*(n-i))%mod

ans -= 1
ans = (ans-(nca*rev(kaijo(a)))%mod)%mod
ans = (ans-(ncb*rev(kaijo(b)))%mod)%mod

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = map(int,input().split())
mod = 10**9+7

def rev(x):
    re = 10**9+5
    num = 1
    ix = x
    while re > 0:
        if re%2 == 1:
            num = (num*ix)%mod
        re //= 2
        ix = (ix**2)%mod
    return(num)

kaijo = [0 for i in range(n+1)]
kaijo[0] = 1
for i in range(1,n+1):
    kaijo[i] = (kaijo[i-1]*i)%mod

re = n
ans = 1
i2 = 2
while re > 0:
    if re%2 == 1:
        ans = (ans*i2)%mod
    re //= 2
    i2 = (i2**2)%mod

ans -= 1
ans = (ans - (((kaijo[n]*rev(kaijo[a]))%mod)*rev(kaijo[n-a]))%mod)%mod
ans = (ans - (((kaijo[n]*rev(kaijo[b]))%mod)*rev(kaijo[n-b]))%mod)%mod
print(ans)


Fixed submission:
n, a, b = map(int,input().split())
mod = 10**9+7

def rev(x):
    re = 10**9+5
    num = 1
    ix = x
    while re > 0:
        if re%2 == 1:
            num = (num*ix)%mod
        re //= 2
        ix = (ix**2)%mod
    return(num)

def kaijo(x):
    num = 1
    for i in range(1,x+1):
        num = (num*i)%mod
    return(num)

re = n
ans = 1
i2 = 2
while re > 0:
    if re%2 == 1:
        ans = (ans*i2)%mod
    re //= 2
    i2 = (i2**2)%mod
nca = 1
ncb = 1
for i in range(a):
    nca = (nca*(n-i))%mod
for i in range(b):
    ncb = (ncb*(n-i))%mod

ans -= 1
ans = (ans-(nca*rev(kaijo(a)))%mod)%mod
ans = (ans-(ncb*rev(kaijo(b)))%mod)%mod

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
sn = []
for i in range(n):
    si = str(input())
    if si in s:
        sn[s.index(si)] += 1
    else:
        s.append(si)
        sn.append(1)

ma = max(sn)
kouho = []
for i in range(len(s)):
    if ma == sn[i]:
        kouho.append(s[i])

kouho.sort()
for i in kouho:
    print(i)


Fixed submission:
n = int(input())
d = dict()

for i in range(n):
    s = str(input())
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

M = max(d.values())
ans = []
for k,v in d.items():
    if v == M:
        ans.append(k)

ans.sort()
for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
import numpt as np
n, k = map(int,input().split())
p = np.array(input().split(),dtype=int)

sum = 0
for i in range(k):
    sum += p[i]
max = sum
for i in range(n-k):
    sum = sum+p[k+i]-p[i]
    if max<sum:
        max = sum
print(max/k)


Fixed submission:
import numpy as np
n, k = map(int,input().split())
p = np.array(input().split(),dtype=int)

sum = 0
for i in range(k):
    sum += p[i]
max = sum
for i in range(n-k):
    sum = sum+p[k+i]-p[i]
    if max<sum:
        max = sum
print(max/2+0.5*k)