output_description: Print the number of possible combinations of numbers of people in the n rooms
  now, modulo (10^9 + 7).
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n k
attempt: from sys import stdout
  
  printn = lambda x: stdout.write(str(x))
  inn = lambda: int(input())
  inl = lambda: list(map(int, input().split()))
  inm = lambda: map(int, input().split())
  ins = lambda: input().strip()
  DBG = True and False
  BIG = 999999999
  R = 10**9 + 7
  
  
  def ddprint(x):
      if DBG:
          print(x)
  
  
  def modinv2(x, r):
      return pow(x, r - 2, r)
  
  
  def comb(n, a):
      dend = n
      for i in range(1, a):
          dend = (dend * (n - i)) % R
      sor = 1
      for i in range(2, a + 1):
          sor = (sor * i) % R
      return (dend * modinv2(sor, R)) % R
  
  
  n, k = inm()
  if n - 1 <= k:
      print(comb(2 * n - 1, n - 1))
      exit()
  c = [1] * (k + 1)
  d = [1] * (k + 1)
  for i in range(1, k + 1):
      m = modinv2(i, R)
      c[i] = (c[i - 1] * (n - i + 1) * m) % R
      d[i] = (d[i - 1] * (n - i) * m) % R
  ddprint("c,d")
  ddprint(c)
  ddprint(d)
  sm = 0
  # for j in range(n-k,n+1):
  #    sm = (sm+comb(n,j)*comb(n-1,j-1))%R
  for j in range(k + 1):
      sm = (sm + c[j] * d[j]) % R
  if k == 1:
      sm = (sm - 1) % R
  print(sm)
  
problem_description: Statement
  
  There is a building with n rooms, numbered 1 to n.
  
  We can move from any room to any other room in the building.
  
  Let us call the following event a **move** : a person in some room i goes to
  another room j~ (i \neq j).
  
  Initially, there was one person in each room in the building.
  
  After that, we know that there were exactly k moves happened up to now.
  
  We are interested in the number of people in each of the n rooms now. How many
  combinations of numbers of people in the n rooms are possible?
  
  Find the count modulo (10^9 + 7).
samples: [{"input": "3 2", "output": "10\n    \n\nLet c_1, c_2, and c_3 be the number of people in Room 1, 2, and 3 now,\nrespectively. There are 10 possible combination of (c_1, c_2, c_3):\n\n  * (0, 0, 3)\n  * (0, 1, 2)\n  * (0, 2, 1)\n  * (0, 3, 0)\n  * (1, 0, 2)\n  * (1, 1, 1)\n  * (1, 2, 0)\n  * (2, 0, 1)\n  * (2, 1, 0)\n  * (3, 0, 0)\n\nFor example, (c_1, c_2, c_3) will be (0, 1, 2) if the person in Room 1 goes to\nRoom 2 and then one of the persons in Room 2 goes to Room 3.\n\n* * *"}, {"input": "200000 1000000000", "output": "607923868\n    \n\nPrint the count modulo (10^9 + 7).\n\n* * *"}, {"input": "15 6", "output": "22583772"}]