Buggy python submission (verdict: Runtime Error):

def create_array(n: int, r: int, mod, mod2):
    m_ls = [1] * (r + 1)

    for i, j in zip(range(n, 0, -1), range(1, r + 1)):
        m_ls[j] = (m_ls[j - 1] * i * pow(j, mod2, mod)) % mod
    return m_ls


def main():
    n, a, b = map(int, input().split())
    _mod = 1_000_000_007
    _mod2 = 1_000_000_005

    m_ls = create_array(n, b, _mod, _mod2)

    _all_cnts = pow(2, n, _mod) - 1
    ans = _all_cnts + (_mod - m_ls[a]) + (_mod - m_ls[b])
    ans %= _mod

    print(ans)


main()


Fixed submission:

def create_array(n: int, r: int, mod, mod2):
    m_ls = [1] * (r + 1)

    for i, j in zip(range(n, 0, -1), range(1, r + 1)):
        m_ls[j] = (m_ls[j - 1] * i * pow(j, mod2, mod)) % mod
    return m_ls


def main():
    n, a, b = map(int, input().split())
    _mod = 1000000007
    _mod2 = 1000000005

    m_ls = create_array(n, b, _mod, _mod2)

    _all_cnts = pow(2, n, _mod) - 1
    ans = _all_cnts + (_mod - m_ls[a]) + (_mod - m_ls[b])
    ans %= _mod

    print(ans)


main()

Buggy python submission (verdict: Runtime Error):
class Comb:
    m_vals = []
    _mod = 1_000_000_007
    _mod2 = 1_000_000_005

    def __init__(self, n: int, r: int):
        m_ls = [1] * (r + 1)

        for i, j in zip(range(n, 0, -1), range(1, r + 1)):
            m_ls[j] = (m_ls[j - 1] * i * pow(j, self._mod2, self._mod)) % self._mod

        self.m_vals = m_ls

    def vv(self, x):
        return self.m_vals[x]


def main():
    n, a, b = map(int, input().split())
    _mod = 1_000_000_007
    cmb = Comb(n, b)
    _all_cnts = pow(2, n, _mod) - 1
    ans = _all_cnts + (_mod - cmb.vv(a)) + (_mod - cmb.vv(b))
    ans %= _mod

    print(ans)


main()


Fixed submission:

def create_array(n: int, r: int, mod, mod2):
    m_ls = [1] * (r + 1)

    for i, j in zip(range(n, 0, -1), range(1, r + 1)):
        m_ls[j] = (m_ls[j - 1] * i * pow(j, mod2, mod)) % mod
    return m_ls


def main():
    n, a, b = map(int, input().split())
    _mod = 1000000007
    _mod2 = 1000000005

    m_ls = create_array(n, b, _mod, _mod2)

    _all_cnts = pow(2, n, _mod) - 1
    ans = _all_cnts + (_mod - m_ls[a]) + (_mod - m_ls[b])
    ans %= _mod

    print(ans)


main()

Buggy python submission (verdict: Runtime Error):
import math


class Comb:
    m_vals = []
    _mod = 1_000_000_007
    _mod2 = 1_000_000_005

    def __init__(self, n: int, r: int):
        m_ls = [1] * (r + 1)

        for i,j in zip(range(n, 0, -1), range(1, r+1)):
            m_ls[j] = (m_ls[j-1]*i * pow(j, self._mod2, self._mod)) % self._mod

        self.m_vals = m_ls

    def vv(self, x):
        return self.m_vals[x]


def main():
    n, a, b = map(int, input().split())
    _mod = 1_000_000_007
    cmb = Comb(n,b)
    all = pow(2,n, _mod) -1
    ans = all + (_mod - cmb.vv(a)) + (_mod - cmb.vv(b))
    ans %= _mod

    print(ans)


main()


Fixed submission:

def create_array(n: int, r: int, mod, mod2):
    m_ls = [1] * (r + 1)

    for i, j in zip(range(n, 0, -1), range(1, r + 1)):
        m_ls[j] = (m_ls[j - 1] * i * pow(j, mod2, mod)) % mod
    return m_ls


def main():
    n, a, b = map(int, input().split())
    _mod = 1000000007
    _mod2 = 1000000005

    m_ls = create_array(n, b, _mod, _mod2)

    _all_cnts = pow(2, n, _mod) - 1
    ans = _all_cnts + (_mod - m_ls[a]) + (_mod - m_ls[b])
    ans %= _mod

    print(ans)


main()