import Control.Monad
import Data.List as L
import Data.IntMap as M

primes :: [Integer]
primes = takeWhile (<31623) $ 2:3:p
    where 
        p = 5:q 1 7 p
        q m s (p:ps) = [n|n<-[x+y|x<-[s,s+6..p*p-2],y<-[0,4]],gcd m n<2]++q (m*p) (p*p) ps

fac :: [Integer]->M.IntMap Integer->Integer->M.IntMap Integer
fac _ m 1 = m
fac [] m n = M.insert (fromIntegral n) 1 m
fac pa@(p:pr) m n
    |mod n (fromIntegral p)==0=fac pa (M.insertWith(+) (fromIntegral p) 1 m) (div n (fromIntegral p))
    |otherwise =fac pr m n

invmod a p = invmod' a p p 0 1
    where invmod' a p q x y
            | amq==0 = mod (x+p) p
            | True   = invmod' q p amq (y-(div a q)*x) x
            where amq = mod a q

divmod a b p = mod (a * invmod b p) p

cmbmod n k p = L.foldl' (\a i->divmod (mod (a*(n-i+1)) p) i p) 1 [1..k]

main=do
    (n:m:_)<-L.map read.words<$>getLine::IO[Integer]
    print $ sol n m
--
sol 1 _ = 1
sol _ 1 = 1
sol n m = L.foldl' (\a b -> (a * cmbmod (b+n-1) b 1000000007) `mod` 1000000007) 1 fm
    where fm = elems $ fac primes M.empty m