mod = 10**9+7

def factorials(n,m):
    # 0~n!のリスト
    f = [1,1]
    for i in range(2,n+1):
        f.append(f[-1]*i%m)

    # 0~n!の逆元のリスト
    g = [1]
    for i in range(n):
        g.append(pow(f[i+1],m-2,m))

    return f,g

f,g = factorials(4*10**5,mod)


n,k = map(int, input().split())
if k>=n-1:
    print((f[2*n-1]*g[n]*g[n-1])%mod)
else:
    ans = 0
    for x in range(k+1):
        ans += f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x]
        ans %= mod
    print(ans) mod = 10**9+7 mod 10**9+7 10**9 10 9 7 def factorials(n,m):
    # 0~n!のリスト
    f = [1,1]
    for i in range(2,n+1):
        f.append(f[-1]*i%m)

    # 0~n!の逆元のリスト
    g = [1]
    for i in range(n):
        g.append(pow(f[i+1],m-2,m))

    return f,g factorials f = [1,1] f [1,1] 1 1 for i in range(2,n+1):
        f.append(f[-1]*i%m)

    # 0~n!の逆元のリスト
     i range(2,n+1) range 2 n+1 n 1 f.append(f[-1]*i%m) f.append f append f[-1]*i%m f[-1]*i f[-1] f -1 i m g = [1] g [1] 1 for i in range(n):
        g.append(pow(f[i+1],m-2,m))

     i range(n) range n g.append(pow(f[i+1],m-2,m)) g.append g append pow(f[i+1],m-2,m) pow f[i+1] f i+1 i 1 m-2 m 2 m return f,g return f,g f g n n m m f,g = factorials(4*10**5,mod) f factorials(4*10**5,mod) factorials 4*10**5 4 10**5 10 5 mod g n,k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k if k>=n-1:
    print((f[2*n-1]*g[n]*g[n-1])%mod)
else:
    ans = 0
    for x in range(k+1):
        ans += f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x]
        ans %= mod
    print(ans) k>=n-1 k n-1 n 1 print((f[2*n-1]*g[n]*g[n-1])%mod) print (f[2*n-1]*g[n]*g[n-1])%mod f[2*n-1]*g[n]*g[n-1] f[2*n-1]*g[n] f[2*n-1] f 2*n-1 2*n 2 n 1 g[n] g n g[n-1] g n-1 n 1 mod ans = 0 ans 0 for x in range(k+1):
        ans += f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x]
        ans %= mod
     x range(k+1) range k+1 k 1 ans += f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x] ans f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x] f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x] f[n-1]*g[x]*g[n-x-1]*f[n] f[n-1]*g[x]*g[n-x-1] f[n-1]*g[x] f[n-1] f n-1 n 1 g[x] g x g[n-x-1] g n-x-1 n-x n x 1 f[n] f n g[n-x] g n-x n x g[x] g x ans %= mod ans mod print(ans) print ans ans += f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x] f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x] ans f,g = factorials(4*10**5,mod) factorials(4*10**5,mod) f n,k = map(int, input().split()) map(int, input().split()) n ans = 0 0 ans mod = 10**9+7 10**9+7 mod g = factorials(4*10**5,mod) factorials(4*10**5,mod) g k = map(int, input().split()) map(int, input().split()) k def factorials(n,m):
    # 0~n!のリスト
    f = [1,1]
    for i in range(2,n+1):
        f.append(f[-1]*i%m)

    # 0~n!の逆元のリスト
    g = [1]
    for i in range(n):
        g.append(pow(f[i+1],m-2,m))

    return f,g def factorials(n,m):
    # 0~n!のリスト
    f = [1,1]
    for i in range(2,n+1):
        f.append(f[-1]*i%m)

    # 0~n!の逆元のリスト
    g = [1]
    for i in range(n):
        g.append(pow(f[i+1],m-2,m))

    return f,g factorials ans %= mod mod ans
mod = 10**9+7

def factorials(n,m):
    # 0~n!のリスト
    f = [1,1]
    for i in range(2,n+1):
        f.append(f[-1]*i%m)

    # 0~n!の逆元のリスト
    g = [1]
    for i in range(n):
        g.append(pow(f[i+1],m-2,m))

    return f,g

f,g = factorials(4*10**5,mod)


n,k = map(int, input().split())
if k>=n-1:
    print((f[2*n-1]*g[n]*g[n-1])%mod)
else:
    ans = 0
    for x in range(k+1):
        ans += f[n-1]*g[x]*g[n-x-1]*f[n]*g[n-x]*g[x]
        ans %= mod
    print(ans)