Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10 ** 6)


MOD = 10 ** 9 + 7


def modFact(n):
    global MOD
    if n == 1:
        return 1
    else:
        return (n * modFact(n - 1)) % MOD


def modInvFact(n):
    global MOD
    ans = 1
    for i in range(1, n + 1):
        ans *= pow(i, MOD - 2, MOD)
        ans %= MOD
    return ans


def modCombi(n, r):
    global MOD
    if r == 0:
        return 1
    else:
        N = modFact(n)
        NR = modInvFact(n - r)
        R = modInvFact(r)
    return (N * R * NR) % MOD


N, K = map(int, input().split())

for i in range(1, K + 1):
    A = modCombi(K - 1, i - 1)
    if N - K < i - 1:
        B = 0
    else:
        B = modCombi(N - K + 1, i)
    print((A * B) % MOD)


Fixed submission:
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    factorials = [0] * (n + 1)
    factorials[0] = 1
    for i in range(n):
        factorials[i + 1] = (factorials[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(factorials[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return factorials, invs


N, K = map(int, input().split())

factorials, invs = prepare(N)

for i in range(1, K + 1):
    A = factorials[K - 1] * invs[i - 1] * invs[K - i] % MOD
    if N - K < i - 1:
        B = 0
    else:
        B = factorials[N - K + 1] * invs[i] * invs[N - K + 1 - i] % MOD
    print((A * B) % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10 ** 6)


MOD = 10 ** 9 + 7


def modFact(n):
    global MOD
    if n == 1:
        return 1
    else:
        return (n * modFact(n - 1)) % MOD


def modInvFact(n):
    global MOD
    ans = 1
    for i in range(1, n + 1):
        ans *= modPow(i, MOD - 2)
        ans %= MOD
    return ans


def modCombi(n, r):
    global MOD
    if r == 0:
        return 1
    else:
        N = modFact(n)
        NR = modInvFact(n - r)
        R = modInvFact(r)
    return (N * R * NR) % MOD


def modPow(n, m):
    global MOD
    if m == 0:
        return 1
    elif m % 2 == 1:
        return (n * modPow(n, m - 1)) % MOD
    else:
        d = modPow(n, m // 2)
        return (d * d) % MOD


N, K = map(int, input().split())

for i in range(1, K + 1):
    A = modCombi(K - 1, i - 1)
    if N - K < i - 1:
        B = 0
    else:
        B = modCombi(N - K + 1, i)
    print((A * B) % MOD)


Fixed submission:
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    factorials = [0] * (n + 1)
    factorials[0] = 1
    for i in range(n):
        factorials[i + 1] = (factorials[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(factorials[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return factorials, invs


N, K = map(int, input().split())

factorials, invs = prepare(N)

for i in range(1, K + 1):
    A = factorials[K - 1] * invs[i - 1] * invs[K - i] % MOD
    if N - K < i - 1:
        B = 0
    else:
        B = factorials[N - K + 1] * invs[i] * invs[N - K + 1 - i] % MOD
    print((A * B) % MOD)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10 ** 6)


MOD = 10 ** 9 + 7


def modFact(n):
    global MOD
    if n == 1:
        return 1
    else:
        return (n * modFact(n - 1)) % MOD


def modInvFact(n):
    global MOD
    ans = 1
    for i in range(1, n + 1):
        ans *= pow(i, MOD - 2, MOD)
        ans %= MOD
    return ans


def modCombi(n, r):
    global MOD
    if r == 0:
        return 1
    else:
        N = modFact(n)
        NR = modInvFact(n - r)
        R = modInvFact(r)
    return (N * R * NR) % MOD


N, K = map(int, input().split())

for i in range(1, K + 1):
    A = modCombi(K - 1, i - 1)
    if N - K < i - 1:
        B = 0
    else:
        B = modCombi(N - K + 1, i)
    print((A * B) % MOD)


Fixed submission:
MOD = 10 ** 9 + 7


def prepare(n):
    global MOD
    factorials = [0] * (n + 1)
    factorials[0] = 1
    for i in range(n):
        factorials[i + 1] = (factorials[i] * (i + 1)) % MOD

    invs = [1] * (n + 1)
    invs[n] = pow(factorials[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD

    return factorials, invs


N, K = map(int, input().split())

factorials, invs = prepare(N)

for i in range(1, K + 1):
    A = factorials[K - 1] * invs[i - 1] * invs[K - i] % MOD
    if N - K < i - 1:
        B = 0
    else:
        B = factorials[N - K + 1] * invs[i] * invs[N - K + 1 - i] % MOD
    print((A * B) % MOD)