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

mod=10**9+7

def modinv(x):
    return pow(x,mod-2,mod)

ans=1
comb1=1
comb2=1

for i in range(1,min(n-1,k)+1):
    comb1*=(n-i+1)*modinv(i)
    comb2*=(n-i)*modinv(i)
    comb1%=mod
    comb2%=mod

    ans+=comb1*comb2
    ans%=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 def modinv(x):
    return pow(x,mod-2,mod) modinv return pow(x,mod-2,mod) pow(x,mod-2,mod) pow x mod-2 mod 2 mod x x ans=1 ans 1 comb1=1 comb1 1 comb2=1 comb2 1 for i in range(1,min(n-1,k)+1):
    comb1*=(n-i+1)*modinv(i)
    comb2*=(n-i)*modinv(i)
    comb1%=mod
    comb2%=mod

    ans+=comb1*comb2
    ans%=mod i range(1,min(n-1,k)+1) range 1 min(n-1,k)+1 min(n-1,k) min n-1 n 1 k 1 comb1*=(n-i+1)*modinv(i) comb1 (n-i+1)*modinv(i) n-i+1 n-i n i 1 modinv(i) modinv i comb2*=(n-i)*modinv(i) comb2 (n-i)*modinv(i) n-i n i modinv(i) modinv i comb1%=mod comb1 mod comb2%=mod comb2 mod ans+=comb1*comb2 ans comb1*comb2 comb1 comb2 ans%=mod ans mod print(ans) print ans comb2*=(n-i)*modinv(i) (n-i)*modinv(i) comb2 ans=1 1 ans comb1*=(n-i+1)*modinv(i) (n-i+1)*modinv(i) comb1 ans+=comb1*comb2 comb1*comb2 ans n,k=list(map(int,input().split())) list(map(int,input().split())) n def modinv(x):
    return pow(x,mod-2,mod) def modinv(x):
    return pow(x,mod-2,mod) modinv ans%=mod mod ans comb1%=mod mod comb1 comb2%=mod mod comb2 k=list(map(int,input().split())) list(map(int,input().split())) k mod=10**9+7 10**9+7 mod comb1=1 1 comb1 comb2=1 1 comb2
n,k=list(map(int,input().split()))

mod=10**9+7

def modinv(x):
    return pow(x,mod-2,mod)

ans=1
comb1=1
comb2=1

for i in range(1,min(n-1,k)+1):
    comb1*=(n-i+1)*modinv(i)
    comb2*=(n-i)*modinv(i)
    comb1%=mod
    comb2%=mod

    ans+=comb1*comb2
    ans%=mod

print(ans)