module constants
  implicit none
  integer(8), parameter :: modulo = 10**9 + 7
end module constants

program abc110d
  use constants
  implicit none
  integer(8) :: ans = 1, i = 2
  integer(8) n, m, count
  read *, n, m
  do
     if (m < i * i) exit
     if (mod(m, i) == 0) then
        count = 0
        do
           m = m / i;
           count = count + 1
           if (mod(m, i) /= 0) exit
        end do
        ans = mod(ans * comb(n + count - 1, count), modulo)
     end if
     i = i + 1
  end do
  if (m /= 1) then
     ans = mod(ans * n, modulo)
  end if
  print *, ans

contains

  recursive integer(8) function comb(n, k) result(r)
    integer(8), intent(in) :: n, k
    integer(8) i, numer, denom
    if (n - k < k) then
       r = comb(n, n - k)
    else
       numer = 1
       denom = 1
       do i = 0, k - 1
          numer = mod(numer * (n - i), modulo)
          denom = mod(denom * (i + 1), modulo)
       end do
       r = mod(numer * modpow(denom, modulo - 2), modulo)
    end if
  end function comb

  recursive integer(8) function modpow(a, p) result(r)
    integer(8), intent(in) :: a, p
    if (p == 0) then
       r = 1
    else if (mod(p, 2) == 0) then
       r = mod(modpow(a, p / 2)**2, modulo)
    else
       r = mod(a * modpow(a, p - 1), modulo)
    end if
  end function modpow

end program abc110d
