import collections

import math

n,m=list(map(int,input().split()))

flag=0

P=[]

p=m

while flag==0:

  cur=p

  for i in range(2,int(p**0.5)+1):

    if p%i==0:

      P.append(i)

      p//=i

      break

  if p==cur:

    P.append(p)

    flag=1

c=collections.Counter(P)

Primes=set(P)

def f(i):

  return math.factorial(i)

def fn(i):

  return f(n+i-1)//(f(n-1)*f(i))%(10**9+7)

ans=1

for p in Primes:

  ans*=fn(c[p])

  ans%=(10**9+7)

print((1 if m==1 else ans)) 

import sys

input=lambda: sys.stdin.readline().rstrip()

mod=10**9+7

n,m=list(map(int,input().split()))

n_max=2*(10**5+1)

F,FI=[0]*(n_max+1),[0]*(n_max+1)

F[0],FI[0]=1,1

for i in range(n_max):

  F[i+1]=(F[i]*(i+1))%mod

FI[n_max-1]=pow(F[n_max-1],mod-2,mod)

for i in reversed(list(range(n_max-1))):

  FI[i]=(FI[i+1]*(i+1))%mod

def comb(x,y):

  return (F[x]*FI[x-y]*FI[y])%mod



pf={}

for i in range(2,int(m**0.5)+1):

  while m%i==0:

    pf[i]=pf.get(i,0)+1

    m//=i

if m>1:

  pf[m]=1



ans=1

for k in list(pf.keys()):

  ans=(ans*comb(n-1+pf[k],pf[k]))%mod

print(ans)
import collections
import math

n, m = list(map(int, input().split()))
flag = 0
P = []
p = m
while flag == 0:
    cur = p
    for i in range(2, int(p**0.5) + 1):
        if p % i == 0:
            P.append(i)
            p //= i
            break
    if p == cur:
        P.append(p)
        flag = 1
c = collections.Counter(P)
Primes = set(P)


def f(i):
    return math.factorial(i)


def fn(i):
    return f(n + i - 1) // (f(n - 1) * f(i)) % (10**9 + 7)


ans = 1
for p in Primes:
    ans *= fn(c[p])
    ans %= 10**9 + 7
print((1 if m == 1 else ans))

import sys

input = lambda: sys.stdin.readline().rstrip()
mod = 10**9 + 7
n, m = list(map(int, input().split()))
n_max = 2 * (10**5 + 1)
F, FI = [0] * (n_max + 1), [0] * (n_max + 1)
F[0], FI[0] = 1, 1
for i in range(n_max):
    F[i + 1] = (F[i] * (i + 1)) % mod
FI[n_max - 1] = pow(F[n_max - 1], mod - 2, mod)
for i in reversed(list(range(n_max - 1))):
    FI[i] = (FI[i + 1] * (i + 1)) % mod


def comb(x, y):
    return (F[x] * FI[x - y] * FI[y]) % mod


pf = {}
for i in range(2, int(m**0.5) + 1):
    while m % i == 0:
        pf[i] = pf.get(i, 0) + 1
        m //= i
if m > 1:
    pf[m] = 1
ans = 1
for k in list(pf.keys()):
    ans = (ans * comb(n - 1 + pf[k], pf[k])) % mod
print(ans)

-import collections -import math +import sys +input = lambda: sys.stdin.readline().rstrip() +mod = 10**9 + 7 -flag = 0 -P = [] -p = m -while flag == 0: -    cur = p -    for i in range(2, int(p**0.5) + 1): -        if p % i == 0: -            P.append(i) -            p //= i -            break -    if p == cur: -        P.append(p) -        flag = 1 -c = collections.Counter(P) -Primes = set(P) +n_max = 2 * (10**5 + 1) +F, FI = [0] * (n_max + 1), [0] * (n_max + 1) +F[0], FI[0] = 1, 1 +for i in range(n_max): +    F[i + 1] = (F[i] * (i + 1)) % mod +FI[n_max - 1] = pow(F[n_max - 1], mod - 2, mod) +for i in reversed(list(range(n_max - 1))): +    FI[i] = (FI[i + 1] * (i + 1)) % mod -def f(i): -    return math.factorial(i) +def comb(x, y): +    return (F[x] * FI[x - y] * FI[y]) % mod -def fn(i): -    return f(n + i - 1) // (f(n - 1) * f(i)) % (10**9 + 7) - - +pf = {} +for i in range(2, int(m**0.5) + 1): +    while m % i == 0: +        pf[i] = pf.get(i, 0) + 1 +        m //= i +if m > 1: +    pf[m] = 1 -for p in Primes: -    ans *= fn(c[p]) -    ans %= 10**9 + 7 -print((1 if m == 1 else ans)) +for k in list(pf.keys()): +    ans = (ans * comb(n - 1 + pf[k], pf[k])) % mod +print(ans)