n,k = map(int,input().split())
p = pow(10,9)+7
li = [1]*(n+2)

counter = 0
k = min(k,n-1)

for a in range(1,n+1):
    li[a] = a*li[a-1]%p

def comb(a,b):
    if b<1:
        return 1
    return li[a]*pow(li[b],p-2,p)*pow(li[a-b],p-2,p)


for i in range(k+1):
    counter += comb(n,i)*comb(n-1,i)%p
    #nCi*  (n-1)Cn-i-1


    #n人をn-iのぐるーぷに分ける

print(counter%p) n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k p = pow(10,9)+7 p pow(10,9)+7 pow(10,9) pow 10 9 7 li = [1]*(n+2) li [1]*(n+2) [1] 1 n+2 n 2 counter = 0 counter 0 k = min(k,n-1) k min(k,n-1) min k n-1 n 1 for a in range(1,n+1):
    li[a] = a*li[a-1]%p a range(1,n+1) range 1 n+1 n 1 li[a] = a*li[a-1]%p li[a] li a a*li[a-1]%p a*li[a-1] a li[a-1] li a-1 a 1 p def comb(a,b):
    if b<1:
        return 1
    return li[a]*pow(li[b],p-2,p)*pow(li[a-b],p-2,p) comb if b<1:
        return 1
     b<1 b 1 return 1 1 return li[a]*pow(li[b],p-2,p)*pow(li[a-b],p-2,p) li[a]*pow(li[b],p-2,p)*pow(li[a-b],p-2,p) li[a]*pow(li[b],p-2,p) li[a] li a pow(li[b],p-2,p) pow li[b] li b p-2 p 2 p pow(li[a-b],p-2,p) pow li[a-b] li a-b a b p-2 p 2 p a a b b for i in range(k+1):
    counter += comb(n,i)*comb(n-1,i)%p
    #nCi*  (n-1)Cn-i-1


    #n人をn-iのぐるーぷに分ける i range(k+1) range k+1 k 1 counter += comb(n,i)*comb(n-1,i)%p counter comb(n,i)*comb(n-1,i)%p comb(n,i)*comb(n-1,i) comb(n,i) comb n i comb(n-1,i) comb n-1 n 1 i p print(counter%p) print counter%p counter p p = pow(10,9)+7 pow(10,9)+7 p def comb(a,b):
    if b<1:
        return 1
    return li[a]*pow(li[b],p-2,p)*pow(li[a-b],p-2,p) def comb(a,b):
    if b<1:
        return 1
    return li[a]*pow(li[b],p-2,p)*pow(li[a-b],p-2,p) comb n,k = map(int,input().split()) map(int,input().split()) n li = [1]*(n+2) [1]*(n+2) li counter = 0 0 counter counter += comb(n,i)*comb(n-1,i)%p comb(n,i)*comb(n-1,i)%p counter k = map(int,input().split()) map(int,input().split()) k k = min(k,n-1) min(k,n-1) k
n,k = map(int,input().split())
p = pow(10,9)+7
li = [1]*(n+2)

counter = 0
k = min(k,n-1)

for a in range(1,n+1):
    li[a] = a*li[a-1]%p

def comb(a,b):
    if b<1:
        return 1
    return li[a]*pow(li[b],p-2,p)*pow(li[a-b],p-2,p)


for i in range(k+1):
    counter += comb(n,i)*comb(n-1,i)%p
    #nCi*  (n-1)Cn-i-1


    #n人をn-iのぐるーぷに分ける

print(counter%p)