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

mod = 10**9 + 7
k = min(k, n-1)

def choose(n, r):
    x = 1
    y = 1
    for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod-2, mod)) % mod

kaijo = [1]
for i in range(1,n+1): 
  kaijo.append(kaijo[i-1]*i % mod)

ans = 0
for i in range(k+1):
#    ans += (choose(n, min(i,n-i)) * choose(n-1, min(i,n-1-i))) % mod
    ans += (kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod) * (kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod)
    ans = ans % mod
print(ans % mod) n, k = list(map(int, input().split())) n list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split k mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 k = min(k, n-1) k min(k, n-1) min k n-1 n 1 def choose(n, r):
    x = 1
    y = 1
    for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod-2, mod)) % mod choose x = 1 x 1 y = 1 y 1 for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
     i range(1, r+1) range 1 r+1 r 1 x = (x * (n-i+1)) % mod x (x * (n-i+1)) % mod x * (n-i+1) x n-i+1 n-i n i 1 mod y = (y * i) % mod y (y * i) % mod y * i y i mod return (x * pow(y, mod-2, mod)) % mod (x * pow(y, mod-2, mod)) % mod x * pow(y, mod-2, mod) x pow(y, mod-2, mod) pow y mod-2 mod 2 mod mod n n r r kaijo = [1] kaijo [1] 1 for i in range(1,n+1): 
  kaijo.append(kaijo[i-1]*i % mod) i range(1,n+1) range 1 n+1 n 1 kaijo.append(kaijo[i-1]*i % mod) kaijo.append kaijo append kaijo[i-1]*i % mod kaijo[i-1]*i kaijo[i-1] kaijo i-1 i 1 i mod ans = 0 ans 0 for i in range(k+1):
#    ans += (choose(n, min(i,n-i)) * choose(n-1, min(i,n-1-i))) % mod
    ans += (kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod) * (kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod)
    ans = ans % mod i range(k+1) range k+1 k 1 ans += (kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod) * (kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod) ans (kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod) * (kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod) kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) kaijo[n] kaijo n pow(kaijo[i]*kaijo[n-i], mod-2,mod) pow kaijo[i]*kaijo[n-i] kaijo[i] kaijo i kaijo[n-i] kaijo n-i n i mod-2 mod 2 mod mod kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) kaijo[n-1] kaijo n-1 n 1 pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) pow kaijo[i]*kaijo[n-1-i] kaijo[i] kaijo i kaijo[n-1-i] kaijo n-1-i n-1 n 1 i mod-2 mod 2 mod mod ans = ans % mod ans ans % mod ans mod print(ans % mod) print ans % mod ans mod mod = 10**9 + 7 10**9 + 7 mod def choose(n, r):
    x = 1
    y = 1
    for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod-2, mod)) % mod def choose(n, r):
    x = 1
    y = 1
    for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod-2, mod)) % mod choose ans += (kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod) * (kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod) (kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod) * (kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod) ans kaijo = [1] [1] kaijo k = list(map(int, input().split())) list(map(int, input().split())) k k = min(k, n-1) min(k, n-1) k n, k = list(map(int, input().split())) list(map(int, input().split())) n ans = 0 0 ans ans = ans % mod ans % mod ans
n, k = list(map(int, input().split()))

mod = 10**9 + 7
k = min(k, n-1)

def choose(n, r):
    x = 1
    y = 1
    for i in range(1, r+1):
        x = (x * (n-i+1)) % mod
        y = (y * i) % mod
    return (x * pow(y, mod-2, mod)) % mod

kaijo = [1]
for i in range(1,n+1): 
  kaijo.append(kaijo[i-1]*i % mod)

ans = 0
for i in range(k+1):
#    ans += (choose(n, min(i,n-i)) * choose(n-1, min(i,n-1-i))) % mod
    ans += (kaijo[n] * pow(kaijo[i]*kaijo[n-i], mod-2,mod) % mod) * (kaijo[n-1]*pow(kaijo[i]*kaijo[n-1-i],mod-2,mod) % mod)
    ans = ans % mod
print(ans % mod)
