$pascal = [
  [1],
  [1,1]
]

def pascal(n,i)
  return 1 if n==0
  return $pascal[n][i] if $pascal[n] && $pascal[n][i]

  if n==i || i==0
    $pascal[n] ||= []
    $pascal[n][i] = 1
  else
    $pascal[n] ||= []
    $pascal[n][i] = (pascal(n-1, i-1) + pascal(n-1, i))
  end

  return $pascal[n][i]
end

N,K = readline.strip.split.map(&:to_i)

div =  (10e8+7).to_i

dp = []

(1..K).to_a.each do |i|

  p ( pascal(N-K+1, i)%div * pascal(K-1, i-1)%div)%div

end


