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

mod = 10**9+7
ans = 1%mod
left_combination = 1
right_combination = 1

for i in range(1,min(k,n-1)+1):
    left_combination = (left_combination*(n+1-i)*pow(i,mod-2,mod))%mod
    right_combination = (right_combination*(n-i)*pow(i,mod-2,mod))%mod
    ans = (ans + (left_combination*right_combination)%mod)%mod

print(ans) 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 ans = 1%mod ans 1%mod 1 mod left_combination = 1 left_combination 1 right_combination = 1 right_combination 1 for i in range(1,min(k,n-1)+1):
    left_combination = (left_combination*(n+1-i)*pow(i,mod-2,mod))%mod
    right_combination = (right_combination*(n-i)*pow(i,mod-2,mod))%mod
    ans = (ans + (left_combination*right_combination)%mod)%mod i range(1,min(k,n-1)+1) range 1 min(k,n-1)+1 min(k,n-1) min k n-1 n 1 1 left_combination = (left_combination*(n+1-i)*pow(i,mod-2,mod))%mod left_combination (left_combination*(n+1-i)*pow(i,mod-2,mod))%mod left_combination*(n+1-i)*pow(i,mod-2,mod) left_combination*(n+1-i) left_combination n+1-i n+1 n 1 i pow(i,mod-2,mod) pow i mod-2 mod 2 mod mod right_combination = (right_combination*(n-i)*pow(i,mod-2,mod))%mod right_combination (right_combination*(n-i)*pow(i,mod-2,mod))%mod right_combination*(n-i)*pow(i,mod-2,mod) right_combination*(n-i) right_combination n-i n i pow(i,mod-2,mod) pow i mod-2 mod 2 mod mod ans = (ans + (left_combination*right_combination)%mod)%mod ans (ans + (left_combination*right_combination)%mod)%mod ans + (left_combination*right_combination)%mod ans (left_combination*right_combination)%mod left_combination*right_combination left_combination right_combination mod mod print(ans) print ans n,k =list(map(int,input().split())) list(map(int,input().split())) n ans = 1%mod 1%mod ans k =list(map(int,input().split())) list(map(int,input().split())) k left_combination = (left_combination*(n+1-i)*pow(i,mod-2,mod))%mod (left_combination*(n+1-i)*pow(i,mod-2,mod))%mod left_combination right_combination = (right_combination*(n-i)*pow(i,mod-2,mod))%mod (right_combination*(n-i)*pow(i,mod-2,mod))%mod right_combination ans = (ans + (left_combination*right_combination)%mod)%mod (ans + (left_combination*right_combination)%mod)%mod ans left_combination = 1 1 left_combination right_combination = 1 1 right_combination mod = 10**9+7 10**9+7 mod
n,k =list(map(int,input().split()))

mod = 10**9+7
ans = 1%mod
left_combination = 1
right_combination = 1

for i in range(1,min(k,n-1)+1):
    left_combination = (left_combination*(n+1-i)*pow(i,mod-2,mod))%mod
    right_combination = (right_combination*(n-i)*pow(i,mod-2,mod))%mod
    ans = (ans + (left_combination*right_combination)%mod)%mod

print(ans)