Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

#参考: https://qiita.com/ophhdn/items/e6451ec5983939ecbc5b
def pow(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans


def main():
    n,a,b  = map(int, input().split())
    #a,bの制約がなければ，2^n - 1通りだけ使える
    # 2^n ^ nCa - nCb
    mod = 10**9 +7
    
    mab = max(a, b)
    ncr = [1 for i in range(mab+1)]
    for i in range(mab+1):
        if i == 0:
            continue
        else:
            ncr[i] = ncr[i-1] * (n-i+1) // i % mod

    n2 = pow(2, n) 
    nca = ncr[a]
    ncb = ncr[b] 
    print((n2 - nca - ncb - 1) % mod )
    eprint(n2)
    eprint(nca)
    eprint(ncb)
    return

if __name__ == '__main__':
    main()

Fixed submission:
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def comb(n,r,mod):
    p,q=1,1
    for i in range(r):
        p=p*(n-i)%mod 
        q=q*(i+1)%mod 
    return p*pow(q,mod-2,mod)%mod

def main():
    n,a,b  = map(int, input().split())
    #a,bの制約がなければ，2^n - 1通りだけ使える
    # 2^n ^ nCa - nCb
    mod = 10**9 +7
    nca = comb(n,a,mod)
    ncb = comb(n,b,mod)

    print((pow(2,n,mod)-(nca+ncb)%mod) % mod-1)


    return

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

#参考: https://qiita.com/ophhdn/items/e6451ec5983939ecbc5b
def pow(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans


def main():
    n,a,b  = map(int, input().split())
    #a,bの制約がなければ，2^n - 1通りだけ使える
    # 2^n ^ nCa - nCb
    mod = 10**9 +7
    
    mab = max(a, b)
    ncr = [1 for i in range(mab+1)]
    for i in range(mab+1):
        if i == 0:
            continue
        else:
            ncr[i] = ncr[i-1] * (n-i+1) // i % mod

    n2 = pow(2, n) 
    nca = ncr[a]
    ncb = ncr[b] 
    print((n2 - nca - ncb - 1) % mod )
    eprint(n2)
    eprint(nca)
    eprint(ncb)
    return

if __name__ == '__main__':
    main()

Fixed submission:
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def comb(n,r,mod):
    p,q=1,1
    for i in range(r):
        p=p*(n-i)%mod 
        q=q*(i+1)%mod 
    return p*pow(q,mod-2,mod)%mod

def main():
    n,a,b  = map(int, input().split())
    #a,bの制約がなければ，2^n - 1通りだけ使える
    # 2^n ^ nCa - nCb
    mod = 10**9 +7
    nca = comb(n,a,mod)
    ncb = comb(n,b,mod)

    print((pow(2,n,mod)-(nca+ncb)%mod) % mod-1)


    return

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

#参考: https://qiita.com/ophhdn/items/e6451ec5983939ecbc5b
def pow(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans


def main():
    n,a,b  = map(int, input().split())
    #a,bの制約がなければ，2^n - 1通りだけ使える
    # 2^n ^ nCa - nCb
    mod = 10**9 +7
    
    mab = max(a, b)
    ncr = [1 for i in range(mab+1)]
    for i in range(mab+1):
        if i == 0:
            continue
        else:
            ncr[i] = ncr[i-1] * (n-i+1) // i
            ncr[i]

    n2 = pow(2, n) 
    nca = ncr[a]
    ncb = ncr[b] 
    print((n2 - nca - ncb - 1) % mod )
    eprint(n2)
    eprint(nca)
    eprint(ncb)
    return

if __name__ == '__main__':
    main()

Fixed submission:
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def comb(n,r,mod):
    p,q=1,1
    for i in range(r):
        p=p*(n-i)%mod 
        q=q*(i+1)%mod 
    return p*pow(q,mod-2,mod)%mod

def main():
    n,a,b  = map(int, input().split())
    #a,bの制約がなければ，2^n - 1通りだけ使える
    # 2^n ^ nCa - nCb
    mod = 10**9 +7
    nca = comb(n,a,mod)
    ncb = comb(n,b,mod)

    print((pow(2,n,mod)-(nca+ncb)%mod) % mod-1)


    return

if __name__ == '__main__':
    main()