let len = 101010

let modulo = 1000000007

let (+@) a b = (a + b) mod modulo
let ( *@) a b = (a * b) mod modulo
let rec (^@) a n =
  if n = 0 then 1
  else if n mod 2 = 1 then a *@ (a ^@ (n-1))
  else let h = a ^@ (n/2) in h *@ h

let inv_mod a = a ^@ (modulo - 2)

let facts =
  let res = Array.make len 1 in
  for i = 1 to len-1 do res.(i) <- i *@ res.(i-1); done;
  res

let inv_facts = Array.map inv_mod facts

let comb n k =
  if n < k then 0 else facts.(n) *@ inv_facts.(k) *@ inv_facts.(n-k)

let rec factorize x =
  let rec f d c n =
    if d * d > x then
      if n > 1 then [(n, 1)] else []
    else if n mod d = 0 then f d (c+1) (n / d)
    else if c > 0 then (d, c) :: f (d+1) 0 n else f (d+1) 0 n
  in f 2 0 x

let () =
  Scanf.scanf "%d %d" @@ fun n m ->
  factorize m |> List.fold_left (( fun ans (d, c) ->
    ans *@ comb (n+c-1) c )) 1
  |> Printf.printf "%d\n"
