n, k = map(int, input().split())
mod = 10 ** 9 + 7


def cmb_r(n, r):
    n += r - 1
    return cmb(n, r)


def cmb(n, r, mod=10 ** 9 + 7):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


def make_table2(n, mod=10 ** 9 + 7):
    # 元テーブル
    g1 = [0] * (n + 1)
    g1[0] = 1
    g1[1] = 1
    tmp = 1

    for i in range(2, n + 1):
        tmp = tmp * i % mod
        g1[i] = tmp

    # 逆元テーブル
    g2 = [0] * (n + 1)
    g2[-1] = pow(g1[-1], mod - 2, mod)
    tmp = g2[-1]

    for i in range(n - 1, -1, -1):
        tmp = tmp * (i + 1) % mod
        g2[i] = tmp

    return g1, g2


g1, g2 = make_table2(2 * 10 ** 5 + 2)
answer = 0
for i in range(min(n, k) + 1):
    answer += cmb(n, i) * cmb_r(n - i, i) % mod
    answer %= mod

print(answer) n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 def cmb_r(n, r):
    n += r - 1
    return cmb(n, r) cmb_r n += r - 1 n r - 1 r 1 return cmb(n, r) cmb(n, r) cmb n r n n r r def cmb(n, r, mod=10 ** 9 + 7):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod cmb if r < 0 or r > n:
        return 0
     r < 0 or r > n r < 0 r 0 r > n r n return 0 0 r = min(r, n - r) r min(r, n - r) min r n - r n r return g1[n] * g2[r] * g2[n - r] % mod g1[n] * g2[r] * g2[n - r] % mod g1[n] * g2[r] * g2[n - r] g1[n] * g2[r] g1[n] g1 n g2[r] g2 r g2[n - r] g2 n - r n r mod n n r r mod=10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 def make_table2(n, mod=10 ** 9 + 7):
    # 元テーブル
    g1 = [0] * (n + 1)
    g1[0] = 1
    g1[1] = 1
    tmp = 1

    for i in range(2, n + 1):
        tmp = tmp * i % mod
        g1[i] = tmp

    # 逆元テーブル
    g2 = [0] * (n + 1)
    g2[-1] = pow(g1[-1], mod - 2, mod)
    tmp = g2[-1]

    for i in range(n - 1, -1, -1):
        tmp = tmp * (i + 1) % mod
        g2[i] = tmp

    return g1, g2 make_table2 g1 = [0] * (n + 1) g1 [0] * (n + 1) [0] 0 n + 1 n 1 g1[0] = 1 g1[0] g1 0 1 g1[1] = 1 g1[1] g1 1 1 tmp = 1 tmp 1 for i in range(2, n + 1):
        tmp = tmp * i % mod
        g1[i] = tmp

    # 逆元テーブル
     i range(2, n + 1) range 2 n + 1 n 1 tmp = tmp * i % mod tmp tmp * i % mod tmp * i tmp i mod g1[i] = tmp g1[i] g1 i tmp g2 = [0] * (n + 1) g2 [0] * (n + 1) [0] 0 n + 1 n 1 g2[-1] = pow(g1[-1], mod - 2, mod) g2[-1] g2 -1 pow(g1[-1], mod - 2, mod) pow g1[-1] g1 -1 mod - 2 mod 2 mod tmp = g2[-1] tmp g2[-1] g2 -1 for i in range(n - 1, -1, -1):
        tmp = tmp * (i + 1) % mod
        g2[i] = tmp

     i range(n - 1, -1, -1) range n - 1 n 1 -1 -1 tmp = tmp * (i + 1) % mod tmp tmp * (i + 1) % mod tmp * (i + 1) tmp i + 1 i 1 mod g2[i] = tmp g2[i] g2 i tmp return g1, g2 return g1, g2 g1 g2 n n mod=10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 g1, g2 = make_table2(2 * 10 ** 5 + 2) g1 make_table2(2 * 10 ** 5 + 2) make_table2 2 * 10 ** 5 + 2 2 * 10 ** 5 2 10 ** 5 10 5 2 g2 answer = 0 answer 0 for i in range(min(n, k) + 1):
    answer += cmb(n, i) * cmb_r(n - i, i) % mod
    answer %= mod i range(min(n, k) + 1) range min(n, k) + 1 min(n, k) min n k 1 answer += cmb(n, i) * cmb_r(n - i, i) % mod answer cmb(n, i) * cmb_r(n - i, i) % mod cmb(n, i) * cmb_r(n - i, i) cmb(n, i) cmb n i cmb_r(n - i, i) cmb_r n - i n i i mod answer %= mod answer mod print(answer) print answer mod = 10 ** 9 + 7 10 ** 9 + 7 mod k = map(int, input().split()) map(int, input().split()) k def cmb_r(n, r):
    n += r - 1
    return cmb(n, r) def cmb_r(n, r):
    n += r - 1
    return cmb(n, r) cmb_r g1, g2 = make_table2(2 * 10 ** 5 + 2) make_table2(2 * 10 ** 5 + 2) g1 answer = 0 0 answer answer %= mod mod answer def make_table2(n, mod=10 ** 9 + 7):
    # 元テーブル
    g1 = [0] * (n + 1)
    g1[0] = 1
    g1[1] = 1
    tmp = 1

    for i in range(2, n + 1):
        tmp = tmp * i % mod
        g1[i] = tmp

    # 逆元テーブル
    g2 = [0] * (n + 1)
    g2[-1] = pow(g1[-1], mod - 2, mod)
    tmp = g2[-1]

    for i in range(n - 1, -1, -1):
        tmp = tmp * (i + 1) % mod
        g2[i] = tmp

    return g1, g2 def make_table2(n, mod=10 ** 9 + 7):
    # 元テーブル
    g1 = [0] * (n + 1)
    g1[0] = 1
    g1[1] = 1
    tmp = 1

    for i in range(2, n + 1):
        tmp = tmp * i % mod
        g1[i] = tmp

    # 逆元テーブル
    g2 = [0] * (n + 1)
    g2[-1] = pow(g1[-1], mod - 2, mod)
    tmp = g2[-1]

    for i in range(n - 1, -1, -1):
        tmp = tmp * (i + 1) % mod
        g2[i] = tmp

    return g1, g2 make_table2 g2 = make_table2(2 * 10 ** 5 + 2) make_table2(2 * 10 ** 5 + 2) g2 def cmb(n, r, mod=10 ** 9 + 7):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod def cmb(n, r, mod=10 ** 9 + 7):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod cmb answer += cmb(n, i) * cmb_r(n - i, i) % mod cmb(n, i) * cmb_r(n - i, i) % mod answer n, k = map(int, input().split()) map(int, input().split()) n
n, k = map(int, input().split())
mod = 10 ** 9 + 7


def cmb_r(n, r):
    n += r - 1
    return cmb(n, r)


def cmb(n, r, mod=10 ** 9 + 7):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


def make_table2(n, mod=10 ** 9 + 7):
    # 元テーブル
    g1 = [0] * (n + 1)
    g1[0] = 1
    g1[1] = 1
    tmp = 1

    for i in range(2, n + 1):
        tmp = tmp * i % mod
        g1[i] = tmp

    # 逆元テーブル
    g2 = [0] * (n + 1)
    g2[-1] = pow(g1[-1], mod - 2, mod)
    tmp = g2[-1]

    for i in range(n - 1, -1, -1):
        tmp = tmp * (i + 1) % mod
        g2[i] = tmp

    return g1, g2


g1, g2 = make_table2(2 * 10 ** 5 + 2)
answer = 0
for i in range(min(n, k) + 1):
    answer += cmb(n, i) * cmb_r(n - i, i) % mod
    answer %= mod

print(answer)