import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")



M = 10**9+7
N = 4*10**5+3 # 必要なテーブルサイズ

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

g1 = [None] * (N+1) # 元テーブル
g2 = [None] * (N+1) #逆元テーブル
inverse = [None] * (N+1) #逆元テーブル計算用テーブル
g1[0] = g1[1] = g2[0] = g2[1] = 1
inverse[0], inverse[1] = [0, 1] 

for i in range( 2, N + 1 ):
    g1[i] = ( g1[i-1] * i ) % M 
    inverse[i] = ( -inverse[M % i] * (M//i) ) % M # ai+b==0 mod M <=> i==-b*a^(-1) <=> i^(-1)==-b^(-1)*aより
    g2[i] = (g2[i-1] * inverse[i]) % M 

n,k = map(int, input().split())
M = 10**9+7
if k<n:
    ans = 0
    for p in range(k+1):
        ans += cmb(n,p,M) * cmb(n-1, p, M)
        ans %= M
else:
    ans = cmb(2*n-1,n,M)
print(ans) import sys sys input = lambda : sys.stdin.readline().rstrip() input lambda : sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip sys.setrecursionlimit(max(1000, 10**9)) sys.setrecursionlimit sys setrecursionlimit max(1000, 10**9) max 1000 10**9 10 9 write = lambda x: sys.stdout.write(x+"\n") write lambda x: sys.stdout.write(x+"\n") sys.stdout.write(x+"\n") sys.stdout.write sys.stdout sys stdout write x+"\n" x "\n" x M = 10**9+7 M 10**9+7 10**9 10 9 7 N = 4*10**5+3 N 4*10**5+3 4*10**5 4 10**5 10 5 3 def cmb(n, r, M):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return (g1[n] * g2[r] * g2[n-r]) % M 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]) % M (g1[n] * g2[r] * g2[n-r]) % M 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 M n n r r M M g1 = [None] * (N+1) g1 [None] * (N+1) [None] None N+1 N 1 g2 = [None] * (N+1) g2 [None] * (N+1) [None] None N+1 N 1 inverse = [None] * (N+1) inverse [None] * (N+1) [None] None N+1 N 1 g1[0] = g1[1] = g2[0] = g2[1] = 1 g1[0] g1 0 1 = g1[1] = g2[0] = g2[1] = 1 g1[1] g1 1 1 g2[0] g2 0 g2[1] g2 1 inverse[0], inverse[1] = [0, 1] inverse[0] inverse 0 [0, 1] 0 1 inverse[1] inverse 1 for i in range( 2, N + 1 ):
    g1[i] = ( g1[i-1] * i ) % M 
    inverse[i] = ( -inverse[M % i] * (M//i) ) % M # ai+b==0 mod M <=> i==-b*a^(-1) <=> i^(-1)==-b^(-1)*aより
    g2[i] = (g2[i-1] * inverse[i]) % M  i range( 2, N + 1 ) range 2 N + 1 N 1 g1[i] = ( g1[i-1] * i ) % M g1[i] g1 i ( g1[i-1] * i ) % M g1[i-1] * i g1[i-1] g1 i-1 i 1 i M inverse[i] = ( -inverse[M % i] * (M//i) ) % M inverse[i] inverse i ( -inverse[M % i] * (M//i) ) % M -inverse[M % i] * (M//i) -inverse[M % i] inverse[M % i] inverse M % i M i M//i M i M g2[i] = (g2[i-1] * inverse[i]) % M g2[i] g2 i (g2[i-1] * inverse[i]) % M g2[i-1] * inverse[i] g2[i-1] g2 i-1 i 1 inverse[i] inverse i M n,k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k M = 10**9+7 M 10**9+7 10**9 10 9 7 if k<n:
    ans = 0
    for p in range(k+1):
        ans += cmb(n,p,M) * cmb(n-1, p, M)
        ans %= M
else:
    ans = cmb(2*n-1,n,M) k<n k n ans = 0 ans 0 for p in range(k+1):
        ans += cmb(n,p,M) * cmb(n-1, p, M)
        ans %= M p range(k+1) range k+1 k 1 ans += cmb(n,p,M) * cmb(n-1, p, M) ans cmb(n,p,M) * cmb(n-1, p, M) cmb(n,p,M) cmb n p M cmb(n-1, p, M) cmb n-1 n 1 p M ans %= M ans M ans = cmb(2*n-1,n,M) ans cmb(2*n-1,n,M) cmb 2*n-1 2*n 2 n 1 n M print(ans) print ans n,k = map(int, input().split()) map(int, input().split()) n N = 4*10**5+3 4*10**5+3 N g2 = [None] * (N+1) [None] * (N+1) g2 ans = cmb(2*n-1,n,M) cmb(2*n-1,n,M) ans k = map(int, input().split()) map(int, input().split()) k ans = 0 0 ans write = lambda x: sys.stdout.write(x+"\n") lambda x: sys.stdout.write(x+"\n") write M = 10**9+7 10**9+7 M input = lambda : sys.stdin.readline().rstrip() lambda : sys.stdin.readline().rstrip() input def cmb(n, r, M):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return (g1[n] * g2[r] * g2[n-r]) % M def cmb(n, r, M):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return (g1[n] * g2[r] * g2[n-r]) % M cmb ans += cmb(n,p,M) * cmb(n-1, p, M) cmb(n,p,M) * cmb(n-1, p, M) ans g1 = [None] * (N+1) [None] * (N+1) g1 ans %= M M ans M = 10**9+7 10**9+7 M inverse = [None] * (N+1) [None] * (N+1) inverse
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")



M = 10**9+7
N = 4*10**5+3 # 必要なテーブルサイズ

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

g1 = [None] * (N+1) # 元テーブル
g2 = [None] * (N+1) #逆元テーブル
inverse = [None] * (N+1) #逆元テーブル計算用テーブル
g1[0] = g1[1] = g2[0] = g2[1] = 1
inverse[0], inverse[1] = [0, 1] 

for i in range( 2, N + 1 ):
    g1[i] = ( g1[i-1] * i ) % M 
    inverse[i] = ( -inverse[M % i] * (M//i) ) % M # ai+b==0 mod M <=> i==-b*a^(-1) <=> i^(-1)==-b^(-1)*aより
    g2[i] = (g2[i-1] * inverse[i]) % M 

n,k = map(int, input().split())
M = 10**9+7
if k<n:
    ans = 0
    for p in range(k+1):
        ans += cmb(n,p,M) * cmb(n-1, p, M)
        ans %= M
else:
    ans = cmb(2*n-1,n,M)
print(ans)