N, K = [int(_) for _ in input().split()]
MOD = 10 ** 9 + 7

ans = 0


class ModFactorial:
    """
    階乗, 組み合わせ, 順列の計算
    """

    def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

    def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

    def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

    def factorial(self, n):
        return self.kaijo[n]


mf = ModFactorial(N, MOD)
for i in range(1, N + 1):
    if N - i > K: continue

    p = N - i
    # print(i, p, mf.nCm(p + i - 1, i - 1))
    ans += mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i)
    ans %= MOD
print(ans) int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ N, K = [int(_) for _ in input().split()] N [int(_) for _ in input().split()] K MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 ans = 0 ans 0 class ModFactorial:
    """
    階乗, 組み合わせ, 順列の計算
    """

    def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

    def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

    def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

    def factorial(self, n):
        return self.kaijo[n] ModFactorial """
    階乗, 組み合わせ, 順列の計算
    """ def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

     __init__ """

        :param n: 最大の要素数.
        :param MOD:
        """ kaijo = [0] * (n + 10) kaijo [0] * (n + 10) [0] 0 n + 10 n 10 gyaku = [0] * (n + 10) gyaku [0] * (n + 10) [0] 0 n + 10 n 10 kaijo[0] = 1 kaijo[0] kaijo 0 1 kaijo[1] = 1 kaijo[1] kaijo 1 1 for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
         i range(2, len(kaijo)) range 2 len(kaijo) len kaijo kaijo[i] = (i * kaijo[i - 1]) % MOD kaijo[i] kaijo i (i * kaijo[i - 1]) % MOD i * kaijo[i - 1] i kaijo[i - 1] kaijo i - 1 i 1 MOD gyaku[0] = 1 gyaku[0] gyaku 0 1 gyaku[1] = 1 gyaku[1] gyaku 1 1 for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
         i range(2, len(gyaku)) range 2 len(gyaku) len gyaku gyaku[i] = pow(kaijo[i], MOD - 2, MOD) gyaku[i] gyaku i pow(kaijo[i], MOD - 2, MOD) pow kaijo[i] kaijo i MOD - 2 MOD 2 MOD self.kaijo = kaijo self.kaijo self kaijo kaijo self.gyaku = gyaku self.gyaku self gyaku gyaku self.MOD = MOD self.MOD self MOD MOD self self n n MOD=10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

     nCm return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m] self.kaijo[n] * self.gyaku[n - m] self.kaijo[n] self.kaijo self kaijo n self.gyaku[n - m] self.gyaku self gyaku n - m n m self.gyaku[m] self.gyaku self gyaku m self.MOD self MOD self self n n m m def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

     nPm return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD (self.kaijo[n] * self.gyaku[n - m]) % self.MOD self.kaijo[n] * self.gyaku[n - m] self.kaijo[n] self.kaijo self kaijo n self.gyaku[n - m] self.gyaku self gyaku n - m n m self.MOD self MOD self self n n m m def factorial(self, n):
        return self.kaijo[n] factorial return self.kaijo[n] self.kaijo[n] self.kaijo self kaijo n self self n n mf = ModFactorial(N, MOD) mf ModFactorial(N, MOD) ModFactorial N MOD for i in range(1, N + 1):
    if N - i > K: continue

    p = N - i
    # print(i, p, mf.nCm(p + i - 1, i - 1))
    ans += mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i)
    ans %= MOD i range(1, N + 1) range 1 N + 1 N 1 if N - i > K: continue

     N - i > K N - i N i K p = N - i p N - i N i ans += mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i) ans mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i) mf.nCm(p + i - 1, i - 1) mf.nCm mf nCm p + i - 1 p + i p i 1 i - 1 i 1 mf.nCm(N, i) mf.nCm mf nCm N i ans %= MOD ans MOD print(ans) print ans ans = 0 0 ans MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD ans += mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i) mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i) ans class ModFactorial:
    """
    階乗, 組み合わせ, 順列の計算
    """

    def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

    def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

    def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

    def factorial(self, n):
        return self.kaijo[n] class ModFactorial:
    """
    階乗, 組み合わせ, 順列の計算
    """

    def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

    def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

    def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

    def factorial(self, n):
        return self.kaijo[n] ModFactorial mf = ModFactorial(N, MOD) ModFactorial(N, MOD) mf ans %= MOD MOD ans N, K = [int(_) for _ in input().split()] [int(_) for _ in input().split()] N p = N - i N - i p K = [int(_) for _ in input().split()] [int(_) for _ in input().split()] K
N, K = [int(_) for _ in input().split()]
MOD = 10 ** 9 + 7

ans = 0


class ModFactorial:
    """
    階乗, 組み合わせ, 順列の計算
    """

    def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

    def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

    def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

    def factorial(self, n):
        return self.kaijo[n]


mf = ModFactorial(N, MOD)
for i in range(1, N + 1):
    if N - i > K: continue

    p = N - i
    # print(i, p, mf.nCm(p + i - 1, i - 1))
    ans += mf.nCm(p + i - 1, i - 1) * mf.nCm(N, i)
    ans %= MOD
print(ans)
