import Data.Int
import Data.List (sort)

md = 1000000007

mul_ :: Int64 -> Int64 -> Int64
mul_ x y = ( x * y )`mod` md

power_ :: Int64 -> Int64 -> Int64
power_ _ 0 = 1 
power_ x y = power_ (x `mul_` x) (y `div` 2) `mul_` if even y then 1 else x

div_ :: Int64 -> Int64 -> Int64
div_ x y = x `mul_` (power_ y (md - 2))

solve2 :: Int64 -> Int64 -> Int64 -> Int64 -> Int64 -> [Int64] -> [Int64]
solve2 _ _ 0    _    _ result = reverse result
solve2 l k i_ sum1 sum2 result = 
    solve2 l k (i_ - 1) next_sum1 next_sum2 (result_ : result)
    where
        i = k - i_ + 1
        next_sum1 = sum1 `mul_` (l + 2 - i) `div_` i
        next_sum2 = sum2 `mul_` if 1 == i then 1 else ((k - i + 1)`div_` (i - 1)) 
        result_ = next_sum1 `mul_` next_sum2

solve :: [Int64] -> [Int64]
solve (n:k:_)  = 
    solve2 (n-k) k k 1 1 []
    
main = interact $ unlines.(map show).solve.map read.words
