# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations, accumulate
from operator import add, mul, sub, itemgetter, attrgetter


import sys
# sys.setrecursionlimit(10**6)
# readline = sys.stdin.buffer.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        error_print(e - s, 'sec')
        return ret

    return wrap


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod//i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n-r)
        return self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD


@mt
def slv(N, K):
    ans = 0
    M = 10**9 + 7

    C = Combination(N*2+1, M)
    def H(n, r):
        return C(n+r-1, r)

    K = min(N-1, K)
    for k in range(K+1):
        m = N - k
        t = C(N, k) * H(m, k)
        ans += t
        ans %= M

    return ans


def main():
    N, K = read_int_n()
    print(slv(N, K))


if __name__ == '__main__':
    main() import bisect bisect import heapq heapq import math math import random random from collections import Counter, defaultdict, deque from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal from fractions import Fraction from functools import lru_cache, reduce from itertools import combinations, combinations_with_replacement, product, permutations, accumulate from operator import add, mul, sub, itemgetter, attrgetter import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline INF = 2**62-1 INF 2**62-1 2**62 2 62 1 def read_int():
    return int(readline()) read_int return int(readline()) int(readline()) int readline() readline def read_int_n():
    return list(map(int, readline().split())) read_int_n return list(map(int, readline().split())) list(map(int, readline().split())) list map(int, readline().split()) map int readline().split() ().split () readline split def read_float():
    return float(readline()) read_float return float(readline()) float(readline()) float readline() readline def read_float_n():
    return list(map(float, readline().split())) read_float_n return list(map(float, readline().split())) list(map(float, readline().split())) list map(float, readline().split()) map float readline().split() ().split () readline split def read_str():
    return readline().strip() read_str return readline().strip() readline().strip() ().strip () readline strip def read_str_n():
    return readline().strip().split() read_str_n return readline().strip().split() readline().strip().split() ().strip().split ().strip() ().strip () readline strip split def error_print(*args):
    print(*args, file=sys.stderr) error_print print(*args, file=sys.stderr) print *args args file=sys.stderr file sys.stderr sys stderr *args def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        error_print(e - s, 'sec')
        return ret

    return wrap mt import time time def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        error_print(e - s, 'sec')
        return ret

     wrap s = time.perf_counter() s time.perf_counter() time.perf_counter time perf_counter ret = f(*args, **kwargs) ret f(*args, **kwargs) f *args args **kwargs kwargs e = time.perf_counter() e time.perf_counter() time.perf_counter time perf_counter error_print(e - s, 'sec') error_print e - s e s 'sec' return ret ret *args **kwargs return wrap wrap f f class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod//i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n-r)
        return self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD Combination def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod//i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

     __init__ g1 = [1, 1] g1 [1, 1] 1 1 g2 = [1, 1] g2 [1, 1] 1 1 inverse = [0, 1] inverse [0, 1] 0 1 for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod//i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
         i range(2, n + 1) range 2 n + 1 n 1 g1.append((g1[-1] * i) % mod) g1.append g1 append (g1[-1] * i) % mod g1[-1] * i g1[-1] g1 -1 i mod inverse.append((-inverse[mod % i] * (mod//i)) % mod) inverse.append inverse append (-inverse[mod % i] * (mod//i)) % mod -inverse[mod % i] * (mod//i) -inverse[mod % i] inverse[mod % i] inverse mod % i mod i mod//i mod i mod g2.append((g2[-1] * inverse[-1]) % mod) g2.append g2 append (g2[-1] * inverse[-1]) % mod g2[-1] * inverse[-1] g2[-1] g2 -1 inverse[-1] inverse -1 mod self.MOD = mod self.MOD self MOD mod self.N = n self.N self N n self.g1 = g1 self.g1 self g1 g1 self.g2 = g2 self.g2 self g2 g2 self.inverse = inverse self.inverse self inverse inverse self self n n mod mod def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n-r)
        return self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD __call__ 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 self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD self.g1[n] * self.g2[r] * self.g2[n-r] self.g1[n] * self.g2[r] self.g1[n] self.g1 self g1 n self.g2[r] self.g2 self g2 r self.g2[n-r] self.g2 self g2 n-r n r self.MOD self MOD self self n n r r def slv(N, K):
    ans = 0
    M = 10**9 + 7

    C = Combination(N*2+1, M)
    def H(n, r):
        return C(n+r-1, r)

    K = min(N-1, K)
    for k in range(K+1):
        m = N - k
        t = C(N, k) * H(m, k)
        ans += t
        ans %= M

    return ans slv ans = 0 ans 0 M = 10**9 + 7 M 10**9 + 7 10**9 10 9 7 C = Combination(N*2+1, M) C Combination(N*2+1, M) Combination N*2+1 N*2 N 2 1 M def H(n, r):
        return C(n+r-1, r)

     H return C(n+r-1, r) C(n+r-1, r) C n+r-1 n+r n r 1 r n n r r K = min(N-1, K) K min(N-1, K) min N-1 N 1 K for k in range(K+1):
        m = N - k
        t = C(N, k) * H(m, k)
        ans += t
        ans %= M

     k range(K+1) range K+1 K 1 m = N - k m N - k N k t = C(N, k) * H(m, k) t C(N, k) * H(m, k) C(N, k) C N k H(m, k) H m k ans += t ans t ans %= M ans M return ans ans N N K K @mt slv mt slv def main():
    N, K = read_int_n()
    print(slv(N, K)) main N, K = read_int_n() N read_int_n() read_int_n K print(slv(N, K)) print slv(N, K) slv N K if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        error_print(e - s, 'sec')
        return ret

    return wrap def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        error_print(e - s, 'sec')
        return ret

    return wrap mt def main():
    N, K = read_int_n()
    print(slv(N, K)) def main():
    N, K = read_int_n()
    print(slv(N, K)) main readline = sys.stdin.readline sys.stdin.readline readline def read_float_n():
    return list(map(float, readline().split())) def read_float_n():
    return list(map(float, readline().split())) read_float_n def read_str_n():
    return readline().strip().split() def read_str_n():
    return readline().strip().split() read_str_n INF = 2**62-1 2**62-1 INF def read_float():
    return float(readline()) def read_float():
    return float(readline()) read_float def slv(N, K):
    ans = 0
    M = 10**9 + 7

    C = Combination(N*2+1, M)
    def H(n, r):
        return C(n+r-1, r)

    K = min(N-1, K)
    for k in range(K+1):
        m = N - k
        t = C(N, k) * H(m, k)
        ans += t
        ans %= M

    return ans def slv(N, K):
    ans = 0
    M = 10**9 + 7

    C = Combination(N*2+1, M)
    def H(n, r):
        return C(n+r-1, r)

    K = min(N-1, K)
    for k in range(K+1):
        m = N - k
        t = C(N, k) * H(m, k)
        ans += t
        ans %= M

    return ans slv def read_int():
    return int(readline()) def read_int():
    return int(readline()) read_int class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod//i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n-r)
        return self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod//i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n-r)
        return self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD Combination def read_int_n():
    return list(map(int, readline().split())) def read_int_n():
    return list(map(int, readline().split())) read_int_n def read_str():
    return readline().strip() def read_str():
    return readline().strip() read_str def error_print(*args):
    print(*args, file=sys.stderr) def error_print(*args):
    print(*args, file=sys.stderr) error_print
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from fractions import Fraction
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations, accumulate
from operator import add, mul, sub, itemgetter, attrgetter


import sys
# sys.setrecursionlimit(10**6)
# readline = sys.stdin.buffer.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(readline())


def read_int_n():
    return list(map(int, readline().split()))


def read_float():
    return float(readline())


def read_float_n():
    return list(map(float, readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.perf_counter()
        ret = f(*args, **kwargs)
        e = time.perf_counter()

        error_print(e - s, 'sec')
        return ret

    return wrap


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod//i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n-r)
        return self.g1[n] * self.g2[r] * self.g2[n-r] % self.MOD


@mt
def slv(N, K):
    ans = 0
    M = 10**9 + 7

    C = Combination(N*2+1, M)
    def H(n, r):
        return C(n+r-1, r)

    K = min(N-1, K)
    for k in range(K+1):
        m = N - k
        t = C(N, k) * H(m, k)
        ans += t
        ans %= M

    return ans


def main():
    N, K = read_int_n()
    print(slv(N, K))


if __name__ == '__main__':
    main()
