module mod_factorization
  implicit none
  integer(8), parameter :: d = 10**9 + 7
contains
  function h(a,b) result(c)
    implicit none
    integer(8), intent(in) :: a, b
    integer(8)             :: c, i, u, l, n, k
    u = 1
    l = 1
    n = a+b-1
    k = b
    if (n-k .lt. k) k = n-k
    do i = 1, k
       u = u * (n-i+1)
       u = mod(u,d)
       l = l * i
       l = mod(l,d)
    end do
    c = mod(u*pinv(l,d-2),d)
    return
  end function h

  recursive function pinv(m,p) result(k)
    implicit none
    integer(8), intent(in) :: m, p
    integer(8)             :: k, h
    if (p .eq. 0) then
       k = 1
       return
    end if
    if (mod(p,2) .eq. 0) then
       h = mod(pinv(m,p/2),d)
       k = mod(h*h,d)
       return
    else
       k = mod(m*pinv(m,p-1),d)
       return
    end if
  end function pinv
end module mod_factorization

program factorization
  use mod_factorization
  implicit none
  integer(8) :: n, m
  integer(8) :: i, sup, count, ans
  read(*,*) n, m
  sup = m
  ans = 1
  do i = 2, sup
     count = 0
     do while (mod(sup,i) .eq. 0)
        count = count + 1
        sup = sup / i
     end do
     if (count .gt. 0) then
        ans = mod(ans*h(n,count),d)
     end if
     if (sup .eq. 1) exit
  end do
  write(*,'(i0)') ans
  stop    
end program factorization