import Control.Applicative

powMod _ 0 _ = 1
powMod base exponent modulus = ((if exponent `mod` 2 == 1 then base else 1) * powMod ((base * base) `mod` modulus) (exponent `div` 2) modulus) `mod` modulus

invMod x p = powMod x (p - 2) p

fallingFactorialMod _ 0 _ = 1
fallingFactorialMod 0 _ _ = 0
fallingFactorialMod x n p = (x * fallingFactorialMod (x - 1) (n - 1) p) `mod` p

combinationMod n k p = ((fallingFactorialMod n k p) * invMod (fallingFactorialMod k k p) p) `mod` p

main = do
  [n, k] <- map read . words <$> getLine
  print $ combinationMod k n (10 ^ 9 + 7)

