n, k = map(int, input().split())
mod = 1000000007

b = mod-2
blis = []
c = 0
while b >0:
  if b & 1 == 1:
    blis.append(c)
  c += 1
  b >>= 1

def modinv(a):
  if a == 1:
    return 1
  else:
    res = 1
    li = []
    for _ in range(c):
      li.append(a%mod)
      a = a*a%mod
    for item in blis:
      res = res *li[item] %mod
    return res

if k >=n:
  L = 2*n-1
  ansbunsi =1
  for j in range(n-1):
    ansbunsi = ansbunsi*L%mod
    L -= 1
  ansbunbo = 1
  L = n - 1
  for j in range(n-1):
    ansbunbo = ansbunbo*L%mod
    L -= 1
  ansbunbo = modinv(ansbunbo)
  print(ansbunsi*ansbunbo%mod)

else:
  kaijou = [1, 1]
  for j in range(2, n):
    kaijou.append(kaijou[-1]*j%mod)
  
  ans = 0

  for m in range(k+1):
    ansbunsi = (kaijou[n-1]**2)*n%mod
    ansbunbo = kaijou[n-m-1]*kaijou[m]%mod
    ansbunbo = ansbunbo*ansbunbo%mod*(n-m)%mod
    ansbunbo = modinv(ansbunbo)
    ans += ansbunbo*ansbunsi%mod
    ans %= mod
  
  print(ans)
     n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k mod = 1000000007 mod 1000000007 b = mod-2 b mod-2 mod 2 blis = [] blis [] c = 0 c 0 while b >0:
  if b & 1 == 1:
    blis.append(c)
  c += 1
  b >>= 1 b >0 b 0 if b & 1 == 1:
    blis.append(c)
   b & 1 == 1 b & 1 b 1 1 blis.append(c) blis.append blis append c c += 1 c 1 b >>= 1 b 1 def modinv(a):
  if a == 1:
    return 1
  else:
    res = 1
    li = []
    for _ in range(c):
      li.append(a%mod)
      a = a*a%mod
    for item in blis:
      res = res *li[item] %mod
    return res modinv if a == 1:
    return 1
  else:
    res = 1
    li = []
    for _ in range(c):
      li.append(a%mod)
      a = a*a%mod
    for item in blis:
      res = res *li[item] %mod
    return res a == 1 a 1 return 1 1 res = 1 res 1 li = [] li [] for _ in range(c):
      li.append(a%mod)
      a = a*a%mod
     _ range(c) range c li.append(a%mod) li.append li append a%mod a mod a = a*a%mod a a*a%mod a*a a a mod for item in blis:
      res = res *li[item] %mod
     item blis res = res *li[item] %mod res res *li[item] %mod res *li[item] res li[item] li item mod return res res a a if k >=n:
  L = 2*n-1
  ansbunsi =1
  for j in range(n-1):
    ansbunsi = ansbunsi*L%mod
    L -= 1
  ansbunbo = 1
  L = n - 1
  for j in range(n-1):
    ansbunbo = ansbunbo*L%mod
    L -= 1
  ansbunbo = modinv(ansbunbo)
  print(ansbunsi*ansbunbo%mod)

else:
  kaijou = [1, 1]
  for j in range(2, n):
    kaijou.append(kaijou[-1]*j%mod)
  
  ans = 0

  for m in range(k+1):
    ansbunsi = (kaijou[n-1]**2)*n%mod
    ansbunbo = kaijou[n-m-1]*kaijou[m]%mod
    ansbunbo = ansbunbo*ansbunbo%mod*(n-m)%mod
    ansbunbo = modinv(ansbunbo)
    ans += ansbunbo*ansbunsi%mod
    ans %= mod
  
  print(ans)
     k >=n k n L = 2*n-1 L 2*n-1 2*n 2 n 1 ansbunsi =1 ansbunsi 1 for j in range(n-1):
    ansbunsi = ansbunsi*L%mod
    L -= 1
   j range(n-1) range n-1 n 1 ansbunsi = ansbunsi*L%mod ansbunsi ansbunsi*L%mod ansbunsi*L ansbunsi L mod L -= 1 L 1 ansbunbo = 1 ansbunbo 1 L = n - 1 L n - 1 n 1 for j in range(n-1):
    ansbunbo = ansbunbo*L%mod
    L -= 1
   j range(n-1) range n-1 n 1 ansbunbo = ansbunbo*L%mod ansbunbo ansbunbo*L%mod ansbunbo*L ansbunbo L mod L -= 1 L 1 ansbunbo = modinv(ansbunbo) ansbunbo modinv(ansbunbo) modinv ansbunbo print(ansbunsi*ansbunbo%mod) print ansbunsi*ansbunbo%mod ansbunsi*ansbunbo ansbunsi ansbunbo mod kaijou = [1, 1] kaijou [1, 1] 1 1 for j in range(2, n):
    kaijou.append(kaijou[-1]*j%mod)
  
   j range(2, n) range 2 n kaijou.append(kaijou[-1]*j%mod) kaijou.append kaijou append kaijou[-1]*j%mod kaijou[-1]*j kaijou[-1] kaijou -1 j mod ans = 0 ans 0 for m in range(k+1):
    ansbunsi = (kaijou[n-1]**2)*n%mod
    ansbunbo = kaijou[n-m-1]*kaijou[m]%mod
    ansbunbo = ansbunbo*ansbunbo%mod*(n-m)%mod
    ansbunbo = modinv(ansbunbo)
    ans += ansbunbo*ansbunsi%mod
    ans %= mod
  
   m range(k+1) range k+1 k 1 ansbunsi = (kaijou[n-1]**2)*n%mod ansbunsi (kaijou[n-1]**2)*n%mod (kaijou[n-1]**2)*n kaijou[n-1]**2 kaijou[n-1] kaijou n-1 n 1 2 n mod ansbunbo = kaijou[n-m-1]*kaijou[m]%mod ansbunbo kaijou[n-m-1]*kaijou[m]%mod kaijou[n-m-1]*kaijou[m] kaijou[n-m-1] kaijou n-m-1 n-m n m 1 kaijou[m] kaijou m mod ansbunbo = ansbunbo*ansbunbo%mod*(n-m)%mod ansbunbo ansbunbo*ansbunbo%mod*(n-m)%mod ansbunbo*ansbunbo%mod*(n-m) ansbunbo*ansbunbo%mod ansbunbo*ansbunbo ansbunbo ansbunbo mod n-m n m mod ansbunbo = modinv(ansbunbo) ansbunbo modinv(ansbunbo) modinv ansbunbo ans += ansbunbo*ansbunsi%mod ans ansbunbo*ansbunsi%mod ansbunbo*ansbunsi ansbunbo ansbunsi mod ans %= mod ans mod print(ans) print ans ansbunbo = ansbunbo*ansbunbo%mod*(n-m)%mod ansbunbo*ansbunbo%mod*(n-m)%mod ansbunbo c += 1 1 c ans += ansbunbo*ansbunsi%mod ansbunbo*ansbunsi%mod ans def modinv(a):
  if a == 1:
    return 1
  else:
    res = 1
    li = []
    for _ in range(c):
      li.append(a%mod)
      a = a*a%mod
    for item in blis:
      res = res *li[item] %mod
    return res def modinv(a):
  if a == 1:
    return 1
  else:
    res = 1
    li = []
    for _ in range(c):
      li.append(a%mod)
      a = a*a%mod
    for item in blis:
      res = res *li[item] %mod
    return res modinv k = map(int, input().split()) map(int, input().split()) k ansbunbo = ansbunbo*L%mod ansbunbo*L%mod ansbunbo b >>= 1 1 b b = mod-2 mod-2 b mod = 1000000007 1000000007 mod blis = [] [] blis ansbunbo = modinv(ansbunbo) modinv(ansbunbo) ansbunbo n, k = map(int, input().split()) map(int, input().split()) n ansbunsi = ansbunsi*L%mod ansbunsi*L%mod ansbunsi L -= 1 1 L c = 0 0 c L = 2*n-1 2*n-1 L L = n - 1 n - 1 L ansbunsi = (kaijou[n-1]**2)*n%mod (kaijou[n-1]**2)*n%mod ansbunsi L -= 1 1 L ansbunbo = modinv(ansbunbo) modinv(ansbunbo) ansbunbo ans = 0 0 ans kaijou = [1, 1] [1, 1] kaijou ans %= mod mod ans ansbunbo = 1 1 ansbunbo ansbunbo = kaijou[n-m-1]*kaijou[m]%mod kaijou[n-m-1]*kaijou[m]%mod ansbunbo ansbunsi =1 1 ansbunsi
n, k = map(int, input().split())
mod = 1000000007

b = mod-2
blis = []
c = 0
while b >0:
  if b & 1 == 1:
    blis.append(c)
  c += 1
  b >>= 1

def modinv(a):
  if a == 1:
    return 1
  else:
    res = 1
    li = []
    for _ in range(c):
      li.append(a%mod)
      a = a*a%mod
    for item in blis:
      res = res *li[item] %mod
    return res

if k >=n:
  L = 2*n-1
  ansbunsi =1
  for j in range(n-1):
    ansbunsi = ansbunsi*L%mod
    L -= 1
  ansbunbo = 1
  L = n - 1
  for j in range(n-1):
    ansbunbo = ansbunbo*L%mod
    L -= 1
  ansbunbo = modinv(ansbunbo)
  print(ansbunsi*ansbunbo%mod)

else:
  kaijou = [1, 1]
  for j in range(2, n):
    kaijou.append(kaijou[-1]*j%mod)
  
  ans = 0

  for m in range(k+1):
    ansbunsi = (kaijou[n-1]**2)*n%mod
    ansbunbo = kaijou[n-m-1]*kaijou[m]%mod
    ansbunbo = ansbunbo*ansbunbo%mod*(n-m)%mod
    ansbunbo = modinv(ansbunbo)
    ans += ansbunbo*ansbunsi%mod
    ans %= mod
  
  print(ans)
    
