n,k=map(int,input().split())
MOD=10**9+7
def comb(n,m,p=10**9+7):
    buf=perm[n]*inv[m]
    buf%=MOD
    buf*=inv[n-m]
    buf%=MOD
    return buf
def inv_mod(a):
  return pow(a,MOD-2,MOD)

perm=[1]*(2*n+1)
for i in range(1,2*n+1):
    perm[i]=perm[i-1]*(i)
    perm[i]%=MOD
inv=[1]*(2*n+1)
inv[-1]=inv_mod(perm[-1])
for i in range(2*n-1,-1,-1):
    inv[i]=inv[i+1]*(i+1)
    inv[i]%=MOD
#print(comb(5,2))
buf=comb(2*n-1,n)
for j in range(k+1,n):
    x=comb(n,j)*comb(n-1,j)
    x%=MOD
    buf-=x
    buf%=MOD
print(buf) n,k=map(int,input().split()) n 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 comb(n,m,p=10**9+7):
    buf=perm[n]*inv[m]
    buf%=MOD
    buf*=inv[n-m]
    buf%=MOD
    return buf comb buf=perm[n]*inv[m] buf perm[n]*inv[m] perm[n] perm n inv[m] inv m buf%=MOD buf MOD buf*=inv[n-m] buf inv[n-m] inv n-m n m buf%=MOD buf MOD return buf buf n n m m p=10**9+7 p 10**9+7 10**9 10 9 7 def inv_mod(a):
  return pow(a,MOD-2,MOD) inv_mod return pow(a,MOD-2,MOD) pow(a,MOD-2,MOD) pow a MOD-2 MOD 2 MOD a a perm=[1]*(2*n+1) perm [1]*(2*n+1) [1] 1 2*n+1 2*n 2 n 1 for i in range(1,2*n+1):
    perm[i]=perm[i-1]*(i)
    perm[i]%=MOD i range(1,2*n+1) range 1 2*n+1 2*n 2 n 1 perm[i]=perm[i-1]*(i) perm[i] perm i perm[i-1]*(i) perm[i-1] perm i-1 i 1 i perm[i]%=MOD perm[i] perm i MOD inv=[1]*(2*n+1) inv [1]*(2*n+1) [1] 1 2*n+1 2*n 2 n 1 inv[-1]=inv_mod(perm[-1]) inv[-1] inv -1 inv_mod(perm[-1]) inv_mod perm[-1] perm -1 for i in range(2*n-1,-1,-1):
    inv[i]=inv[i+1]*(i+1)
    inv[i]%=MOD
#print(comb(5,2)) i range(2*n-1,-1,-1) range 2*n-1 2*n 2 n 1 -1 -1 inv[i]=inv[i+1]*(i+1) inv[i] inv i inv[i+1]*(i+1) inv[i+1] inv i+1 i 1 i+1 i 1 inv[i]%=MOD inv[i] inv i MOD buf=comb(2*n-1,n) buf comb(2*n-1,n) comb 2*n-1 2*n 2 n 1 n for j in range(k+1,n):
    x=comb(n,j)*comb(n-1,j)
    x%=MOD
    buf-=x
    buf%=MOD j range(k+1,n) range k+1 k 1 n x=comb(n,j)*comb(n-1,j) x comb(n,j)*comb(n-1,j) comb(n,j) comb n j comb(n-1,j) comb n-1 n 1 j x%=MOD x MOD buf-=x buf x buf%=MOD buf MOD print(buf) print buf def comb(n,m,p=10**9+7):
    buf=perm[n]*inv[m]
    buf%=MOD
    buf*=inv[n-m]
    buf%=MOD
    return buf def comb(n,m,p=10**9+7):
    buf=perm[n]*inv[m]
    buf%=MOD
    buf*=inv[n-m]
    buf%=MOD
    return buf comb MOD=10**9+7 10**9+7 MOD buf-=x x buf x%=MOD MOD x n,k=map(int,input().split()) map(int,input().split()) n def inv_mod(a):
  return pow(a,MOD-2,MOD) def inv_mod(a):
  return pow(a,MOD-2,MOD) inv_mod buf%=MOD MOD buf inv=[1]*(2*n+1) [1]*(2*n+1) inv x=comb(n,j)*comb(n-1,j) comb(n,j)*comb(n-1,j) x buf=comb(2*n-1,n) comb(2*n-1,n) buf k=map(int,input().split()) map(int,input().split()) k perm=[1]*(2*n+1) [1]*(2*n+1) perm
n,k=map(int,input().split())
MOD=10**9+7
def comb(n,m,p=10**9+7):
    buf=perm[n]*inv[m]
    buf%=MOD
    buf*=inv[n-m]
    buf%=MOD
    return buf
def inv_mod(a):
  return pow(a,MOD-2,MOD)

perm=[1]*(2*n+1)
for i in range(1,2*n+1):
    perm[i]=perm[i-1]*(i)
    perm[i]%=MOD
inv=[1]*(2*n+1)
inv[-1]=inv_mod(perm[-1])
for i in range(2*n-1,-1,-1):
    inv[i]=inv[i+1]*(i+1)
    inv[i]%=MOD
#print(comb(5,2))
buf=comb(2*n-1,n)
for j in range(k+1,n):
    x=comb(n,j)*comb(n-1,j)
    x%=MOD
    buf-=x
    buf%=MOD
print(buf)