import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得
def ST(): return sys.stdin.readline().rstrip()
def LST(): return sys.stdin.readline().rstrip().split()
def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**6+10)

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

mod = MOD #出力の制限
N = 5*10**5
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 )

N,K = MI()
ans = cmb(2*N-1,N-1,MOD)
if K<N-1:
    for i in range(K+1,N):
        ans -= cmb(N,i,MOD)*cmb(N-1,i,MOD)
print(ans%MOD) import sys sys import math math from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN from collections import deque from bisect import bisect_left from itertools import product def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def LI(): return list(map(int, sys.stdin.readline().split())) LI list(map(int, sys.stdin.readline().split())) for i in range(N) for i in range(N) i range(N) range N for i in range(N) list(map(int, sys.stdin.readline().split())) list map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる LI2 N N def LSI(): return list(map(int, list(sys.stdin.readline().rstrip()))) LSI list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N) for i in range(N) i range(N) range N for i in range(N) list(map(int, list(sys.stdin.readline().rstrip()))) list map(int, list(sys.stdin.readline().rstrip())) map int list(sys.stdin.readline().rstrip()) list sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得 LSI2 N N def ST(): return sys.stdin.readline().rstrip() ST def LST(): return sys.stdin.readline().rstrip().split() LST sys.stdin.readline().rstrip().split() for i in range(N) for i in range(N) i range(N) range N for i in range(N) sys.stdin.readline().rstrip().split() sys.stdin.readline().rstrip().split sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip split def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)] LST2 N N i for j in range(h) for j in range(h) j range(h) range h for j in range(h) i def FILL(i,h): return [i for j in range(h)] FILL i i h h FILL(i,w) for j in range(h) for j in range(h) j range(h) range h for j in range(h) FILL(i,w) FILL i w def FILL2(i,h,w): return [FILL(i,w) for j in range(h)] FILL2 i i h h w w FILL2(i,w,d) for j in range(h) for j in range(h) j range(h) range h for j in range(h) FILL2(i,w,d) FILL2 i w d def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)] FILL3 i i h h w w d d FILL3(i,w,d,d2) for j in range(h) for j in range(h) j range(h) range h for j in range(h) FILL3(i,w,d,d2) FILL3 i w d d2 def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)] FILL4 i i h h w w d d d2 d2 def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます sisha num num digit digit MOD = 1000000007 MOD 1000000007 INF = float("inf") INF float("inf") float "inf" sys.setrecursionlimit(10**6+10) sys.setrecursionlimit sys setrecursionlimit 10**6+10 10**6 10 6 10 def cmb(n, r, mod):
    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 mod mod = MOD mod MOD N = 5*10**5 N 5*10**5 5 10**5 10 5 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 N,K = MI() N MI() MI K ans = cmb(2*N-1,N-1,MOD) ans cmb(2*N-1,N-1,MOD) cmb 2*N-1 2*N 2 N 1 N-1 N 1 MOD if K<N-1:
    for i in range(K+1,N):
        ans -= cmb(N,i,MOD)*cmb(N-1,i,MOD) K<N-1 K N-1 N 1 for i in range(K+1,N):
        ans -= cmb(N,i,MOD)*cmb(N-1,i,MOD) i range(K+1,N) range K+1 K 1 N ans -= cmb(N,i,MOD)*cmb(N-1,i,MOD) ans cmb(N,i,MOD)*cmb(N-1,i,MOD) cmb(N,i,MOD) cmb N i MOD cmb(N-1,i,MOD) cmb N-1 N 1 i MOD print(ans%MOD) print ans%MOD ans MOD def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI inverse = [0, 1] [0, 1] inverse def ST(): return sys.stdin.readline().rstrip() def ST(): return sys.stdin.readline().rstrip() ST g1 = [1, 1] [1, 1] g1 def LST(): return sys.stdin.readline().rstrip().split() def LST(): return sys.stdin.readline().rstrip().split() LST def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得 def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得 LSI2 def LI(): return list(map(int, sys.stdin.readline().split())) def LI(): return list(map(int, sys.stdin.readline().split())) LI INF = float("inf") float("inf") INF def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます sisha MOD = 1000000007 1000000007 MOD def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)] def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)] FILL3 def FILL2(i,h,w): return [FILL(i,w) for j in range(h)] def FILL2(i,h,w): return [FILL(i,w) for j in range(h)] FILL2 def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I N,K = MI() MI() N g2 = [1, 1] [1, 1] g2 ans -= cmb(N,i,MOD)*cmb(N-1,i,MOD) cmb(N,i,MOD)*cmb(N-1,i,MOD) ans mod = MOD MOD mod def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる LI2 def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)] def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)] FILL4 def LSI(): return list(map(int, list(sys.stdin.readline().rstrip()))) def LSI(): return list(map(int, list(sys.stdin.readline().rstrip()))) LSI ans = cmb(2*N-1,N-1,MOD) cmb(2*N-1,N-1,MOD) ans def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)] def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)] LST2 K = MI() MI() K def FILL(i,h): return [i for j in range(h)] def FILL(i,h): return [i for j in range(h)] FILL def cmb(n, r, mod):
    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):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod cmb N = 5*10**5 5*10**5 N
import sys
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
from collections import deque
from bisect import bisect_left
from itertools import product
def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
#文字列を一文字ずつ数字に変換、'5678'を[5,6,7,8]とできる
def LSI(): return list(map(int, list(sys.stdin.readline().rstrip())))
def LSI2(N): return [list(map(int, list(sys.stdin.readline().rstrip()))) for i in range(N)]
#文字列として取得
def ST(): return sys.stdin.readline().rstrip()
def LST(): return sys.stdin.readline().rstrip().split()
def LST2(N): return [sys.stdin.readline().rstrip().split() for i in range(N)]
def FILL(i,h): return [i for j in range(h)]
def FILL2(i,h,w): return [FILL(i,w) for j in range(h)]
def FILL3(i,h,w,d): return [FILL2(i,w,d) for j in range(h)]
def FILL4(i,h,w,d,d2): return [FILL3(i,w,d,d2) for j in range(h)]
def sisha(num,digit): return Decimal(str(num)).quantize(Decimal(digit),rounding=ROUND_HALF_UP)
#'0.01'や'1E1'などで指定、整数に戻すならintをかます
MOD = 1000000007
INF = float("inf")
sys.setrecursionlimit(10**6+10)

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

mod = MOD #出力の制限
N = 5*10**5
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 )

N,K = MI()
ans = cmb(2*N-1,N-1,MOD)
if K<N-1:
    for i in range(K+1,N):
        ans -= cmb(N,i,MOD)*cmb(N-1,i,MOD)
print(ans%MOD)
