Problem: Akari has n kinds of flowers, one of each kind.  She is going to choose one or more of these flowers to make a bouquet.  However, she hates two numbers a and b, so the number of flowers in the bouquet cannot be a or b.  How many different bouquets are there that Akari can make?  Find the count modulo (10^9 + 7).  Here, two bouquets are considered different when there is a flower that is used in one of the bouquets but not in the other bouquet.

Submission attempts (in order):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]

#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))


def pow_r_mod(x:int, n:int, mod=10**9+7)->int:
    
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        x %= mod
        n //= 2
    return (K * x) % mod

m, a, b = mi()

P = 10**9+7
N = 2*(10**5)+1
inv_t = [0]+[1]

for i in range(2, N):
  inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

mca = mcb = 1

for i in range(1, a+1):
    mca *= (m-i+1) * inv_t[i]
    mca %= P

mcb = mca

for i in range(a+1, b+1):
    mcb *= (m-i+1) * inv_t[i]
    mcb %= P

print((pow_r_mod(2, m)-1-mca-mcb) % P)

def mpow(x: int, k: int, MOD=1000000007) -> int:
    
    res = 1
    y = x
    while (k):
        if(k % 2 == 1):
            res = (res * y) % MOD
        y = (y ** 2) % MOD
        k = k // 2
    return res

mod = 10**9+7 

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

print(mpow(2,10**9))

num = 1000000000 + 7

MAX_NUM = N
MOD = 10**9+7

fac  = [0 for _ in range(MAX_NUM)]
finv = [0 for _ in range(MAX_NUM)]
inv  = [0 for _ in range(MAX_NUM)]

fac[0]  = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1

for i in range(2,MAX_NUM):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def cmb(n,k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD

#print(mpow(2,N))

print(mpow(2,N)- cmb(N, a) - cmb(N, b) -1)

import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]

#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

def table(n:int, p=10**9+7):
    global fact, factinv, inv
    fact = [1, 1]
    factinv = [1, 1]
    inv = [0, 1]
    for i in range(2, n+1):
        #fact.append((fact[-1] * i) % p)
        inv.append((-inv[p % i] * (p // i)) % p)
        #factinv.append((factinv[-1] * inv[-1]) % p)

m, a, b = mi()

P = 10**9+7
N = 2*(10**5)
table(N)

mca = bunshi= 1
for i in range(1, a+1):
    
    mca *= (m-i+1)
    bunshi *= i 
    mca %= P
    bunshi %= P
mcb = mca
mca = mca * pow(bunshi, P-2, P)
mca %= P

for i in range(a+1, b+1):
    #mcb *= (m-i+1) * inv[i]
    mcb *= (m-i+1)
    bunshi *= i 
    mcb %= P
    bunshi %= P
mcb = mcb * pow(bunshi, P-2, P)
mcb %= P

print((pow(2, m, P)-1-mca-mcb) % P)

Verdicts: Runtime Error

Runtime Error

Accepted