output_description: Print w \times N! modulo (10^9+7), where w is the probability of Snuke's
  winning.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N A
attempt: # さようなら
  n, a = map(int, input().split())
  b = n - a
  mod = 10**9 + 7
  f = [1]
  for i in range(n):
      f += [f[-1] * (i + 1) % mod]
  
  
  def comb(a, b):
      return f[a] * pow(f[b], mod - 2, mod) * pow(f[a - b], mod - 2, mod) % mod
  
  
  ans = 0
  for k in range(1, min(a, b) + 1):
      x = comb(b, k) * f[k]
      y = comb(a, a - k) * f[k]
      z = comb(a, k) * f[k]
      yz = y * z
      t = a - k
      inv = pow(a, mod - 2, mod)
      s = 0
      for l in range(1, t + 1):
          s = (s + comb(a, l) * l * inv) % mod
      yz = (yz - s) % mod
      w = pow(k, b - k, mod) * f[k]
      ans = (ans + w * x * yz) % mod
  print(ans)
  
problem_description: Statement
  
  We have N lamps numbered 1 to N, and N buttons numbered 1 to N. Initially,
  Lamp 1, 2, \cdots, A are on, and the other lamps are off.
  
  Snuke and Ringo will play the following game.
  
    * First, Ringo generates a permutation (p_1,p_2,\cdots,p_N) of (1,2,\cdots,N). The permutation is chosen from all N! possible permutations with equal probability, without being informed to Snuke.
  
    * Then, Snuke does the following operation any number of times he likes:
  
      * Choose a lamp that is on at the moment. (The operation cannot be done if there is no such lamp.) Let Lamp i be the chosen lamp. Press Button i, which switches the state of Lamp p_i. That is, Lamp p_i will be turned off if it is on, and vice versa.
  
  At every moment, Snuke knows which lamps are on. Snuke wins if all the lamps
  are on, and he will surrender when it turns out that he cannot win. What is
  the probability of winning when Snuke plays optimally?
  
  Let w be the probability of winning. Then, w \times N! will be an integer.
  Compute w \times N! modulo (10^9+7).
samples: [{"input": "3 1", "output": "2\n    \n\nFirst, Snuke will press Button 1. If Lamp 1 turns off, he loses. Otherwise, he\nwill press the button that he can now press. If the remaining lamp turns on,\nhe wins; if Lamp 1 turns off, he loses. The probability of winning in this\ngame is 1/3, so we should print (1/3)\\times 3!=2.\n\n* * *"}, {"input": "3 2", "output": "3\n    \n\n* * *"}, {"input": "8 4", "output": "16776\n    \n\n* * *"}, {"input": "9999999 4999", "output": "90395416"}]