modm n = mod n (10^9 + 7)

--product' xs = foldl f 1 xs
--  where
--  f x y = modm $ x * y
product' = product

factorial' n = product' [1..n]

npr' n r = product' [n - i | i <- [0..(r - 1)]]

ncr' n r = modm $ (npr' n r) `div` (factorial' r)

main = do
  let n = 2000
  let k = 3
  mapM_ (putStrLn.show) $ (flip map) [1..k] $ \x -> modm $ product' [(ncr' (n - k + 1) x), (ncr' (k - 1) (x - 1))]
