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

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

 
def comb(n,k,mod):
  """power_funcを用いて(nCk) mod p を求める"""

  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=math.factorial(n) %mod
  b=math.factorial(k) %mod
  c=math.factorial(n-k) %mod
  return (a*pow(b,mod-2,mod)*pow(c,mod-2,mod))%mod

def power_func(a,b,p):
  """a^b mod p を求める"""
  if b==0: return 1
  if b%2==0:
    d=power_func(a,b//2,p)
    return d*d %p
  if b%2==1:
    return (a*power_func(a,b-1,p ))%p

mod=10**9+7
print((pow(2,n,mod)- 1 - comb(n,a,mod) - comb(n,b,mod))%mod)
#2**n - 1 -nCa -nCb

Fixed submission:
import math

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

 
def comb(n,k,mod):
    """power_funcを用いて(nCk) mod p を求める"""
    if n<0 or k<0 or n<k: return 0
    if n==0 or k==0: return 1
    k=min(n-k,k)
    #分母
    deno=1
    #分子
    mole=1

    for i in range(1,k+1):
        mole=mole*(n-i+1)%mod
        deno=deno*i%mod

    return (mole*pow(deno,mod-2,mod))%mod


def power_func(a,b,p):
    """a^b mod p を求める"""
    if b==0: return 1
    if b%2==0:
        d=power_func(a,b//2,p)
    return d*d %p
    
    if b%2==1:
        return (a*power_func(a,b-1,p ))%p

mod=10**9+7
print((pow(2,n,mod)- 1 - comb(n,a,mod) - comb(n,b,mod))%mod)
#2**n - 1 -nCa -nCb

Buggy python submission (verdict: Time Limit Exceeded):
import math
NUM=10**9+7
n,A,B = map(int,input().split())

s=(2**(n))%NUM
k=math.factorial(n)
a1=math.factorial(A)
a2=math.factorial(n-A)

b1=math.factorial(B)
b2=math.factorial(n-B)

a=a1*a2
b=b1*b2
print(s-1-k//a-k//b)

Fixed submission:
import math

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

 
def comb(n,k,mod):
    """power_funcを用いて(nCk) mod p を求める"""
    if n<0 or k<0 or n<k: return 0
    if n==0 or k==0: return 1
    k=min(n-k,k)
    #分母
    deno=1
    #分子
    mole=1

    for i in range(1,k+1):
        mole=mole*(n-i+1)%mod
        deno=deno*i%mod

    return (mole*pow(deno,mod-2,mod))%mod


def power_func(a,b,p):
    """a^b mod p を求める"""
    if b==0: return 1
    if b%2==0:
        d=power_func(a,b//2,p)
    return d*d %p
    
    if b%2==1:
        return (a*power_func(a,b-1,p ))%p

mod=10**9+7
print((pow(2,n,mod)- 1 - comb(n,a,mod) - comb(n,b,mod))%mod)
#2**n - 1 -nCa -nCb

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

n,a,b = map(int,input().split())
k=math.factorial(n)
t=(n-1)//2
L=[1]*(n+1)
L2=[1]*(n+1)
s=1
NUM=10**9+7
for i in range(t):
    L[i+1]*=(n-i)*L[i]
    L2[i+1]*=L[i+1]
    L2[n-i-1]*=L[i+1]
if(n%2==0):
    L2[t+1]*=k
for i in range(t,n):
    L[i+1]*=(n-i)*L[i]
    L2[i+1]*=L[i+1]/k
    L2[n-i-1]*=L[i+1]/k
    L2[i+1]%=NUM
    L2[n-i-1]%=NUM

print(int(sum(L2)-L2[a]-L2[b]-1))

Fixed submission:
import math

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

 
def comb(n,k,mod):
    """power_funcを用いて(nCk) mod p を求める"""
    if n<0 or k<0 or n<k: return 0
    if n==0 or k==0: return 1
    k=min(n-k,k)
    #分母
    deno=1
    #分子
    mole=1

    for i in range(1,k+1):
        mole=mole*(n-i+1)%mod
        deno=deno*i%mod

    return (mole*pow(deno,mod-2,mod))%mod


def power_func(a,b,p):
    """a^b mod p を求める"""
    if b==0: return 1
    if b%2==0:
        d=power_func(a,b//2,p)
    return d*d %p
    
    if b%2==1:
        return (a*power_func(a,b-1,p ))%p

mod=10**9+7
print((pow(2,n,mod)- 1 - comb(n,a,mod) - comb(n,b,mod))%mod)
#2**n - 1 -nCa -nCb