import sys
import math
import itertools
from collections import deque
import copy
import bisect

MOD = 10 ** 9 + 7
INF = 10 ** 18 + 7
input = lambda: sys.stdin.readline().strip()

n, k = map(int, input().split())

inv_list = [1]  # 0で割るというのは定義されないので無視。
for i in range(n):
    inv_list.append(int(MOD - inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) % MOD))
if k >= n:
    ans = 1
    for i in range(2 * n - 1):
        ans *= (i + 1)
        ans %= MOD
    for i in range(n):
        ans *= inv_list[i]
        ans *= inv_list[i]
        ans %= MOD
    ans *= n
    ans %= MOD
    print(ans)
else:
    ans = 1
    nCm = 1
    nmHm = 1
    for i in range(k):
        nCm *= n - i
        nCm *= inv_list[i]
        nCm %= MOD
        nmHm *= (n - 1) - i
        nmHm *= inv_list[i]
        nmHm %= MOD
        ans += nCm * nmHm
        ans %= MOD
    print(ans) import sys sys import math math import itertools itertools from collections import deque import copy copy import bisect bisect MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = 10 ** 18 + 7 INF 10 ** 18 + 7 10 ** 18 10 18 7 input = lambda: sys.stdin.readline().strip() input lambda: sys.stdin.readline().strip() sys.stdin.readline().strip() sys.stdin.readline().strip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline strip n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k inv_list = [1] inv_list [1] 1 for i in range(n):
    inv_list.append(int(MOD - inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) % MOD)) i range(n) range n inv_list.append(int(MOD - inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) % MOD)) inv_list.append inv_list append int(MOD - inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) % MOD) int MOD - inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) % MOD MOD inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) % MOD inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) inv_list[(MOD % (i + 2)) - 1] inv_list (MOD % (i + 2)) - 1 MOD % (i + 2) MOD i + 2 i 2 1 MOD // (i + 2) MOD i + 2 i 2 MOD if k >= n:
    ans = 1
    for i in range(2 * n - 1):
        ans *= (i + 1)
        ans %= MOD
    for i in range(n):
        ans *= inv_list[i]
        ans *= inv_list[i]
        ans %= MOD
    ans *= n
    ans %= MOD
    print(ans)
else:
    ans = 1
    nCm = 1
    nmHm = 1
    for i in range(k):
        nCm *= n - i
        nCm *= inv_list[i]
        nCm %= MOD
        nmHm *= (n - 1) - i
        nmHm *= inv_list[i]
        nmHm %= MOD
        ans += nCm * nmHm
        ans %= MOD
    print(ans) k >= n k n ans = 1 ans 1 for i in range(2 * n - 1):
        ans *= (i + 1)
        ans %= MOD
     i range(2 * n - 1) range 2 * n - 1 2 * n 2 n 1 ans *= (i + 1) ans i + 1 i 1 ans %= MOD ans MOD for i in range(n):
        ans *= inv_list[i]
        ans *= inv_list[i]
        ans %= MOD
     i range(n) range n ans *= inv_list[i] ans inv_list[i] inv_list i ans *= inv_list[i] ans inv_list[i] inv_list i ans %= MOD ans MOD ans *= n ans n ans %= MOD ans MOD print(ans) print ans ans = 1 ans 1 nCm = 1 nCm 1 nmHm = 1 nmHm 1 for i in range(k):
        nCm *= n - i
        nCm *= inv_list[i]
        nCm %= MOD
        nmHm *= (n - 1) - i
        nmHm *= inv_list[i]
        nmHm %= MOD
        ans += nCm * nmHm
        ans %= MOD
     i range(k) range k nCm *= n - i nCm n - i n i nCm *= inv_list[i] nCm inv_list[i] inv_list i nCm %= MOD nCm MOD nmHm *= (n - 1) - i nmHm (n - 1) - i n - 1 n 1 i nmHm *= inv_list[i] nmHm inv_list[i] inv_list i nmHm %= MOD nmHm MOD ans += nCm * nmHm ans nCm * nmHm nCm nmHm ans %= MOD ans MOD print(ans) print ans ans *= inv_list[i] inv_list[i] ans nmHm %= MOD MOD nmHm k = map(int, input().split()) map(int, input().split()) k ans *= inv_list[i] inv_list[i] ans ans = 1 1 ans nCm *= inv_list[i] inv_list[i] nCm nCm *= n - i n - i nCm ans = 1 1 ans MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD ans %= MOD MOD ans nCm %= MOD MOD nCm ans += nCm * nmHm nCm * nmHm ans inv_list = [1] [1] inv_list ans *= n n ans input = lambda: sys.stdin.readline().strip() lambda: sys.stdin.readline().strip() input nmHm = 1 1 nmHm nmHm *= (n - 1) - i (n - 1) - i nmHm nCm = 1 1 nCm ans %= MOD MOD ans INF = 10 ** 18 + 7 10 ** 18 + 7 INF nmHm *= inv_list[i] inv_list[i] nmHm ans %= MOD MOD ans ans %= MOD MOD ans n, k = map(int, input().split()) map(int, input().split()) n ans *= (i + 1) i + 1 ans
import sys
import math
import itertools
from collections import deque
import copy
import bisect

MOD = 10 ** 9 + 7
INF = 10 ** 18 + 7
input = lambda: sys.stdin.readline().strip()

n, k = map(int, input().split())

inv_list = [1]  # 0で割るというのは定義されないので無視。
for i in range(n):
    inv_list.append(int(MOD - inv_list[(MOD % (i + 2)) - 1] * (MOD // (i + 2)) % MOD))
if k >= n:
    ans = 1
    for i in range(2 * n - 1):
        ans *= (i + 1)
        ans %= MOD
    for i in range(n):
        ans *= inv_list[i]
        ans *= inv_list[i]
        ans %= MOD
    ans *= n
    ans %= MOD
    print(ans)
else:
    ans = 1
    nCm = 1
    nmHm = 1
    for i in range(k):
        nCm *= n - i
        nCm *= inv_list[i]
        nCm %= MOD
        nmHm *= (n - 1) - i
        nmHm *= inv_list[i]
        nmHm %= MOD
        ans += nCm * nmHm
        ans %= MOD
    print(ans)
