
div_const::Integer
div_const = (10^9) + 7

primes :: [Int]
primes = sieve (2:[3,5..])
  where
  sieve (p:xs) = p : sieve [x | x <- xs,mod x p > 0]

facts::Int->[Int]->[Int]
facts 1 _        = []
facts n (d:divs) = let kk = length (takeWhile (\k -> mod n (d^k) == 0) [1..]) in
                   kk:(facts (div n  (d^kk)) divs)

prod_lim::[Int]->Int
prod_lim [] = 1
prod_lim (x:xs) = let xi =  toInteger x in
                  let resti = toInteger (prod_lim xs) in
                  fromIntegral (mod (xi * resti) div_const)

comb_lim::Int->Int->Int
comb_lim n k = let ni = toInteger n in
               let ki = toInteger k in
               fromIntegral (div (product [(ki+1)..ni]) (product [1..(ni-ki)]))

div_pat::Int->Int->Int
div_pat k n = comb_lim (k+(n-1)) (n-1)

solver::Int->Int->Int
solver n m = let ls = facts m primes in
             prod_lim (map (\ k -> div_pat k n) ls)

main::IO()
main=do
  d<-getLine
  let n:m:[]=map read (words d)::[Int]
  print (solver n m)
