Buggy python submission (verdict: Runtime Error):
MOD = 10**9+7 # p=MOD
n, a, b = map(int, input().split())
whole = pow(2, n, MOD)-1 # 2^n-1(mod p)を計算。
# nCaの計算
comb1=1
for i in range(n-a+1,n+1): # n*(n-1)*(n-2)*...*(n-a+1)(mod p)を計算
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1): # 1/a!(mod p)を計算 フェルマーの小定理:1/a = a^p-2(mod p)を利用
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod
comb2=1
for i in range(n-b+1,n+1): # n*(n-1)*(n-2)*...*(n-b+1)(mod p)を計算
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
whole -= (comb1+comb2)
whole %= mod
print(whole)

Fixed submission:
mod = 10**9+7 
n, a, b = map(int, input().split())
whole = pow(2, n, mod)-1 # 2^n-1(mod p)を計算。
# nCaの計算
comb1=1
for i in range(n-a+1,n+1): # n*(n-1)*(n-2)*...*(n-a+1)(mod p)を計算
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1): # 1/a!(mod p)を計算 フェルマーの小定理:1/a = a^p-2(mod p)を利用
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod
comb2=1
for i in range(n-b+1,n+1): # n*(n-1)*(n-2)*...*(n-b+1)(mod p)を計算
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
whole -= (comb1+comb2)
whole %= mod
print(whole)

Buggy python submission (verdict: Runtime Error):
MOD = 10**9+7 # p=MOD
n, a, b = map(int, input().split())
whole = pow(2, n, MOD)-1 # 2^n-1(mod p)を計算。
# nCaの計算
comb1=1
for i in range(n-a+1,n+1): # n*(n-1)*(n-2)*...*(n-a+1)(mod p)を計算
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1): # 1/a!(mod p)を計算 フェルマーの小定理:1/a = a^p-2(mod p)を利用
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod
comb2=1
for i in range(n-b+1,n+1): # n*(n-1)*(n-2)*...*(n-b+1)(mod p)を計算
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
ans -= (comb1+comb2)
ans %= mod
print(ans)

Fixed submission:
mod = 10**9+7 
n, a, b = map(int, input().split())
whole = pow(2, n, mod)-1 # 2^n-1(mod p)を計算。
# nCaの計算
comb1=1
for i in range(n-a+1,n+1): # n*(n-1)*(n-2)*...*(n-a+1)(mod p)を計算
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1): # 1/a!(mod p)を計算 フェルマーの小定理:1/a = a^p-2(mod p)を利用
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod
comb2=1
for i in range(n-b+1,n+1): # n*(n-1)*(n-2)*...*(n-b+1)(mod p)を計算
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
whole -= (comb1+comb2)
whole %= mod
print(whole)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

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

if __name__ == "__main__":
    main()

Fixed submission:
mod = 10**9+7 
n, a, b = map(int, input().split())
whole = pow(2, n, mod)-1 # 2^n-1(mod p)を計算。
# nCaの計算
comb1=1
for i in range(n-a+1,n+1): # n*(n-1)*(n-2)*...*(n-a+1)(mod p)を計算
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1): # 1/a!(mod p)を計算 フェルマーの小定理:1/a = a^p-2(mod p)を利用
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod
comb2=1
for i in range(n-b+1,n+1): # n*(n-1)*(n-2)*...*(n-b+1)(mod p)を計算
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
whole -= (comb1+comb2)
whole %= mod
print(whole)

Buggy python submission (verdict: Time Limit Exceeded):
from math import factorial

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

def main():
    n, a, b = map(int, input().split())
    whole = 2**n-1
    a = combinations_count(n, a)
    b = combinations_count(n, b)
    print((whole-a-b)%(10**9+7))

if __name__ == "__main__":
    main()

Fixed submission:
mod = 10**9+7 
n, a, b = map(int, input().split())
whole = pow(2, n, mod)-1 # 2^n-1(mod p)を計算。
# nCaの計算
comb1=1
for i in range(n-a+1,n+1): # n*(n-1)*(n-2)*...*(n-a+1)(mod p)を計算
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1): # 1/a!(mod p)を計算 フェルマーの小定理:1/a = a^p-2(mod p)を利用
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod
comb2=1
for i in range(n-b+1,n+1): # n*(n-1)*(n-2)*...*(n-b+1)(mod p)を計算
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
whole -= (comb1+comb2)
whole %= mod
print(whole)

Buggy python submission (verdict: Runtime Error):
def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))
    
def main():
    n, a, b = map(int, input().split())
    whole = 2**n-1
    a = combinations_count(n, a)
    b = combinations_count(n, b)
    print((whole-a-b)%(10**9+7))

if __name__ == "__main__":
    main()

Fixed submission:
mod = 10**9+7 
n, a, b = map(int, input().split())
whole = pow(2, n, mod)-1 # 2^n-1(mod p)を計算。
# nCaの計算
comb1=1
for i in range(n-a+1,n+1): # n*(n-1)*(n-2)*...*(n-a+1)(mod p)を計算
  comb1 *= i
  comb1 %= mod
for i in range(1,a+1): # 1/a!(mod p)を計算 フェルマーの小定理:1/a = a^p-2(mod p)を利用
  comb1 *= pow(i,mod-2,mod)
  comb1 %= mod
comb2=1
for i in range(n-b+1,n+1): # n*(n-1)*(n-2)*...*(n-b+1)(mod p)を計算
  comb2 *= i
  comb2 %= mod
for i in range(1,b+1):
  comb2 *= pow(i,mod-2,mod)
  comb2 %= mod
whole -= (comb1+comb2)
whole %= mod
print(whole)