from math import sqrt, floor

from collections import defaultdict

def comb(n,m):

    if m == 0:

        return 1

    return comb(n-1,m-1)*n // m

def facts(n):

    dic = defaultdict(int)

    for i in range(2,floor(sqrt(n))+1):

        while n % i == 0:

            n //= i

            dic[i] += 1

        if n == 1:

            break

    if n != 1:

        dic[n] += 1

    return dic

N, M = list(map(int,input().split()))

mod = 10**9+7

ans = 1

dic = facts(M)

for p in dic:

    ans = (ans*(comb(dic[p]+N-1, dic[p]) % mod)) % mod

print(ans)

from math import sqrt,floor

def comb(n,m):

  if m == 0:

    return 1

  return comb(n-1,m-1)*n // m

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

mod=10**9+7

def factorization(x):

  ans=[]

  for i in range(2,floor(sqrt(x))+1):

    if x%i==0:

      cnt=0

      while x%i==0:

        x//=i

        cnt+=1

      ans.append([i,cnt])

      if x==1:

        break

  if x!=1:

    ans.append([x,1])

  return ans

g=factorization(m)

ans=1

for i in g:

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

print(ans)
from math import sqrt, floor
from collections import defaultdict


def comb(n, m):
    if m == 0:
        return 1
    return comb(n - 1, m - 1) * n // m


def facts(n):
    dic = defaultdict(int)
    for i in range(2, floor(sqrt(n)) + 1):
        while n % i == 0:
            n //= i
            dic[i] += 1
        if n == 1:
            break
    if n != 1:
        dic[n] += 1
    return dic


N, M = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1
dic = facts(M)
for p in dic:
    ans = (ans * (comb(dic[p] + N - 1, dic[p]) % mod)) % mod
print(ans)

from math import sqrt, floor


def comb(n, m):
    if m == 0:
        return 1
    return comb(n - 1, m - 1) * n // m


n, m = list(map(int, input().split()))
mod = 10**9 + 7


def factorization(x):
    ans = []
    for i in range(2, floor(sqrt(x)) + 1):
        if x % i == 0:
            cnt = 0
            while x % i == 0:
                x //= i
                cnt += 1
            ans.append([i, cnt])
            if x == 1:
                break
    if x != 1:
        ans.append([x, 1])
    return ans


g = factorization(m)
ans = 1
for i in g:
    ans = (ans * (comb(i[1] + n - 1, i[1]) % mod)) % mod
print(ans)

-from collections import defaultdict -def facts(n): -    dic = defaultdict(int) -    for i in range(2, floor(sqrt(n)) + 1): -        while n % i == 0: -            n //= i -            dic[i] += 1 -        if n == 1: -            break -    if n != 1: -        dic[n] += 1 -    return dic +n, m = list(map(int, input().split())) +mod = 10**9 + 7 -N, M = list(map(int, input().split())) -mod = 10**9 + 7 +def factorization(x): +    ans = [] +    for i in range(2, floor(sqrt(x)) + 1): +        if x % i == 0: +            cnt = 0 +            while x % i == 0: +                x //= i +                cnt += 1 +            ans.append([i, cnt]) +            if x == 1: +                break +    if x != 1: +        ans.append([x, 1]) +    return ans + + +g = factorization(m) -dic = facts(M) -for p in dic: -    ans = (ans * (comb(dic[p] + N - 1, dic[p]) % mod)) % mod +for i in g: +    ans = (ans * (comb(i[1] + n - 1, i[1]) % mod)) % mod