CodeEff/ECCO huggingface dataset:
# Original solution
# -*- coding: utf-8 -*-
from collections import defaultdict

# mod mでの二項係数を求める
class BiCoeff(object):
    def __init__(self, MAX, m):
        super(BiCoeff, self).__init__()
        fac = [0]*MAX
        finv = [0]*MAX
        inv = [0]*MAX

        fac[0] = 1
        fac[1] = 1
        finv[0] = 1
        finv[1] = 1
        inv[1] = 1
        for i in range(2,MAX):
            fac[i] = (fac[i-1]*i)%m
            inv[i] = m - (inv[m%i] * (m//i))%m
            finv[i] = (finv[i-1] * inv[i])%m

        self.MAX = MAX
        self.m = m
        self.fac = fac
        self.finv = finv
        self.inv = inv

    def calc(self,n,k):
        if n<k:
            return 0
        if n<0 or k<0:
            return 0
        return (self.fac[n] * (self.finv[k]*self.finv[n-k])%self.m)%self.m

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

pl = defaultdict(int)
x = m
p = 2
while p*p<x+10:
    while x%p==0:
        pl[p] += 1
        x //= p
    p += 1
if x>1:
    pl[x] += 1


coeff = BiCoeff(10**6, MOD)
res = 1
for k in pl:
    res *= coeff.calc(n+pl[k]-1, pl[k])
    res %= MOD
print(res)


# Optimized solution
# -*- coding: utf-8 -*-
def primeFactors(n):
    res = []
    while n%2==0:
        res.append(2)
        n //= 2
    x = 3
    while n>1 and n>=x*x:
        while n%x==0:
            res.append(x)
            n //= x
        x += 2
    if n>1:
        res.append(n)
    return res

class BiCoeff(object):
    def __init__(self, MAX, m):
        super(BiCoeff, self).__init__()
        fac = [0]*MAX
        finv = [0]*MAX
        inv = [0]*MAX

        fac[0] = 1
        fac[1] = 1
        finv[0] = 1
        finv[1] = 1
        inv[1] = 1
        for i in range(2,MAX):
            fac[i] = (fac[i-1]*i)%m
            inv[i] = m - (inv[m%i] * (m//i))%m
            finv[i] = (finv[i-1] * inv[i])%m

        self.MAX = MAX
        self.m = m
        self.fac = fac
        self.finv = finv
        self.inv = inv

    def calc(self,n,k):
        if n<k:
            return 0
        if n<0 or k<0:
            return 0
        return (self.fac[n] * (self.finv[k]*self.finv[n-k])%self.m)%self.m

from collections import defaultdict
MOD = 10**9 + 7
n,m = list(map(int, input().split()))

bicoeff = BiCoeff(n+100,MOD)

d = defaultdict(int)
for p in primeFactors(m):
    d[p] += 1

res = 1
for v in list(d.values()):
    res *= bicoeff.calc(n-1+v,n-1)
    res %= MOD
print(res)
# Original solution
import math
import collections
n, m = list(map(int, input().split()))

factor = []
tmp = int(m ** (1/2)) + 1
for i in range(2, tmp):
    while m % i == 0:
        m //= i
        factor.append(i)
if m > 1:
    factor.append(m)
num = list(collections.Counter(factor).most_common())

ans = 1
for x in num:
    ans *= (math.factorial(x[1] + n - 1) // (math.factorial(n - 1) * math.factorial(x[1])) % 1000000007)
    ans %= 1000000007
print(ans)

# Optimized solution
import collections
n, m = list(map(int, input().split()))

factor = []
tmp = int(m ** (1/2)) + 1
for i in range(2, tmp):
    while m % i == 0:
        m //= i
        factor.append(i)
if m > 1:
    factor.append(m)
num = list(collections.Counter(factor).most_common())

def comb(n, r):
    tmp = 1
    for i in range(r):
        tmp *= n - i
    for i in range(r):
        tmp //= r - i
    return tmp

ans = 1
for x in num:
    ans *= (comb(x[1] + n - 1, x[1]) % 1000000007)
    ans %= 1000000007
print(ans)
# Original solution
import math
import sys
import collections


mod = 1000000007
sys.setrecursionlimit(mod)
fact = {1: 1}


def run(n, m):
    # print('{}を{}個の数列で表現'.format(m, n))
    ans = 1
    primes = []
    for i in range(2, m):
        if m == 1:
            break
        if i*i > m:
            break
        if m % i == 0:
            cnt = 0
            while m % i == 0:
                cnt += 1
                m //= i
                primes.append(i)
            ans *= comb(cnt+n-1, n-1)
            ans %= mod
    # counts = collections.Counter(primes)
    # print(counts)
    # for (_, v) in counts.items():
    #     ans *= comb(v+n-1, n-1)
    #     ans %= mod
    if m != 1:
        ans *= n
        ans %= mod
    return ans


def comb(n, r):
    mul = math.factorial(n) // math.factorial(n - r)
    div = math.factorial(r)
    # mul = factorial(n) // factorial(n - r)
    # div = factorial(r)
    mul %= mod
    div %= mod
    return (mul * modpow(div, (mod-2))) % mod


'''
def factorial(n):
    if n in fact:
        return fact[n]
    else:
        fact[n] = n*factorial(n-1)
        return fact[n]
'''


def modpow(a, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        halfp = p // 2
        half = modpow(a, halfp)
        return int((half * half) % mod)
    else:
        return int((a * modpow(a, p-1)) % mod)


def main():
    n, m = list(map(int, input().split()))
    print((run(n, m)))


if __name__ == '__main__':
    main()


# Optimized solution
import math
import sys
import collections


mod = 1000000007
sys.setrecursionlimit(mod)
fact = {1: 1}


def run(n, m):
    # print('{}を{}個の数列で表現'.format(m, n))
    ans = 1
    primes = []
    for i in range(2, m):
        if m == 1:
            break
        if i*i > m:
            break
        if m % i == 0:
            cnt = 0
            while m % i == 0:
                cnt += 1
                m //= i
                primes.append(i)
            ans *= comb(cnt+n-1, n-1)
            ans %= mod
    # counts = collections.Counter(primes)
    # print(counts)
    # for (_, v) in counts.items():
    #     ans *= comb(v+n-1, n-1)
    #     ans %= mod
    if m != 1:
        ans *= n
        ans %= mod
    return ans


def comb(n, r):
    if r > (n-r):
        r = n-r
    mul = 1
    div = 1
    for i in range(r):
        mul *= n-i
        div *= i+1
        mul %= mod
        div %= mod
    # mul = math.factorial(n) // math.factorial(n - r)
    # div = math.factorial(r)
    # mul = factorial(n) // factorial(n - r)
    # div = factorial(r)
    mul %= mod
    div %= mod
    return (mul * modpow(div, (mod-2))) % mod


'''
def factorial(n):
    if n in fact:
        return fact[n]
    else:
        fact[n] = n*factorial(n-1)
        return fact[n]
'''


def modpow(a, p):
    if p == 0:
        return 1
    if p % 2 == 0:
        halfp = p // 2
        half = modpow(a, halfp)
        return int((half * half) % mod)
    else:
        return int((a * modpow(a, p-1)) % mod)


def main():
    n, m = list(map(int, input().split()))
    print((run(n, m)))


if __name__ == '__main__':
    main()
# Original solution
import math
mod = 1000000007
N,M = list(map(int,input().strip().split()))
m_sqrt = int(math.sqrt(M))
def P(n, r):
  return math.factorial(n)//math.factorial(n-r)
def C(n, r):
  return P(n, r)//math.factorial(r)

ans = 1
cnt = 0
while  M%2 == 0:
  M = M//2
  cnt += 1
ans *= C(N+cnt-1,cnt)
cnt = 0

for i in range(3,m_sqrt+1,2):
  while M%i == 0:
    M = M//i
    cnt += 1
  if cnt != 0:
    ans *= C(N+cnt-1,cnt)
    cnt = 0
if M != 1:
    ans *= C(N,1)

print((ans%mod))


# Optimized solution
import math
mod = 1000000007
N,M = list(map(int,input().strip().split()))
l = []

def P(n, r):
  return math.factorial(n)//math.factorial(n-r)

def C(n, r):
  return P(n, r)//math.factorial(r)

ans = 1
cnt = 0
while  M%2 == 0:
  M //= 2
  cnt += 1
l.append(cnt)
cnt = 0

i = 3
while i**2 <= M:
  cnt = 0
  while M%i == 0:
    M //= i
    cnt += 1
  if cnt != 0:
    l.append(cnt)
    cnt = 0
  i += 2
if M != 1:
    l.append(1)

for i in l:
  for j in range(i):
    ans = ans*(N+j)//(j+1)

print((ans%mod))
# Original solution
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

MOD = 10**9+7

fac = [1, 1]     # 元テーブル
f_inv = [1, 1]   # 逆元テーブル
inv = [0, 1]     # 逆元テーブル計算用テーブル
def prepare(n, mod):
    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inv.append((-inv[mod % i] * (mod//i)) % mod)
        f_inv.append((f_inv[-1] * inv[-1]) % mod)


def cmb(n, r, mod):
    if n < 0 or r < 0:
        return 0
    if r > n:
        return 0

    return fac[n] * f_inv[r] * f_inv[n-r] % mod


def prime_factorization(n):
    d = []
    i, e = 2, 0  # factor, exponent
    while i * i <= n:
        while n % i == 0:
            n //= i
            e += 1
        if e > 0:
            d.append((i, e))
        i += 1
        e = 0
    if n > 1:
        d.append((n, 1))
    return d


def main():
    N,M = list(map(int, readline().split()))

    prepare(N+100, MOD)
    d = prime_factorization(M)

    ans = 1
    for i, e in d:
        ans *= cmb(N-1+e, e, MOD)
        ans %= MOD

    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

MOD = 10**9+7

fac = [1, 1]     # 元テーブル
f_inv = [1, 1]   # 逆元テーブル
inv = [0, 1]     # 逆元テーブル計算用テーブル
def prepare(n, mod):
    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)


def cmb(n, r, mod):
    if n < 0 or r < 0:
        return 0
    if r > n:
        return 0

    return fac[n] * pow(fac[r],MOD-2,MOD) * pow(fac[n-r],MOD-2,MOD) % mod


def prime_factorization(n):
    d = []
    i, e = 2, 0  # factor, exponent
    while i * i <= n:
        while n % i == 0:
            n //= i
            e += 1
        if e > 0:
            d.append((i, e))
        i += 1
        e = 0
    if n > 1:
        d.append((n, 1))
    return d


def main():
    N,M = list(map(int, readline().split()))

    prepare(N+100, MOD)
    d = prime_factorization(M)

    ans = 1
    for i, e in d:
        ans *= cmb(N-1+e, e, MOD)
        ans %= MOD

    print(ans)


if __name__ == "__main__":
    main()
# Original solution
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

MOD = 10**9+7

fac = [1, 1]     # 元テーブル
f_inv = [1, 1]   # 逆元テーブル
inv = [0, 1]     # 逆元テーブル計算用テーブル
def prepare(n, mod):
    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)


def cmb(n, r, mod):
    if n < 0 or r < 0:
        return 0
    if r > n:
        return 0

    return fac[n] * pow(fac[r],MOD-2,MOD) * pow(fac[n-r],MOD-2,MOD) % mod


def prime_factorization(n):
    d = []
    i, e = 2, 0  # factor, exponent
    while i * i <= n:
        while n % i == 0:
            n //= i
            e += 1
        if e > 0:
            d.append((i, e))
        i += 1
        e = 0
    if n > 1:
        d.append((n, 1))
    return d


def main():
    N,M = list(map(int, readline().split()))

    prepare(N+100, MOD)
    d = prime_factorization(M)

    ans = 1
    for i, e in d:
        ans *= cmb(N-1+e, e, MOD)
        ans %= MOD

    print(ans)


if __name__ == "__main__":
    main()


# Optimized solution
# AC: msec(Python3)
from math import factorial
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

MOD = 10**9+7

def cmb(n, r):
    if n < 0 or r < 0:
        return 0
    if r > n:
        return 0

    r = min(n-r, r)
    res = 1
    for i in range(r):
        res *= n - i

    return res // factorial(r)


def prime_factorization(n):
    d = []
    i, e = 2, 0  # factor, exponent
    while i * i <= n:
        while n % i == 0:
            n //= i
            e += 1
        if e > 0:
            d.append((i, e))
        i += 1
        e = 0
    if n > 1:
        d.append((n, 1))
    return d


def main():
    N,M = list(map(int, readline().split()))

    d = prime_factorization(M)

    ans = 1
    for i, e in d:
        ans *= cmb(N-1+e, e)
        ans %= MOD

    print(ans)


if __name__ == "__main__":
    main()
# Original solution
from math import factorial

def pff(m):
    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
    return pf



def comb(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))


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

anst = int(1)
for i in list(L.values()):
    anst *= comb(i+N-1, i)
    anst = anst%1000000007

ans = anst
print(ans)

# Optimized solution
from math import factorial
from operator import mul
from functools import reduce

def comb2(n,r):
    r = min(n - r, r)
    if r == 0: return 1
    over = reduce(mul, list(range(n, n - r, -1)))
    under = reduce(mul, list(range(1, r + 1)))
    return over // under

def pff(m):
    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
    return pf

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


anst = int(1)
for i in list(L.values()):
    anst *= comb2(i+N-1, i)
    anst = anst%1000000007

ans = anst
print(ans)
# Original solution
import math

def main():
    N,M = list(map(int,input().split()))
    div_list = []
    d = 2
    ans = 1
    while M != 1:
        count = 0
        while M%d == 0:
            count += 1
            M //= d
        div_list.append(count)
        d += 1
    for i in div_list:
        a = math.factorial(i+N-1)
        b = math.factorial(i)
        c = math.factorial(N-1)
        ans *= (a//(b*c))%(10**9+7)
    print((ans%(10**9+7)))

if __name__ == "__main__":
    main()

# Optimized solution
import sys
input = sys.stdin.buffer.readline
from collections import defaultdict
import copy

def main():
    N,M = list(map(int,input().split()))
    d = defaultdict(int)
    MOD = 10**9+7
    R = 10**5+100
    fac = [0 for _ in range(R+1)]
    fac[0],fac[1] = 1,1
    inv = copy.deepcopy(fac)
    invfac = copy.deepcopy(fac)
    
    for i in range(2,R+1):
        fac[i] = (fac[i-1]*i)%MOD
        inv[i] = MOD-(MOD//i)*inv[MOD%i]%MOD
        invfac[i] = (invfac[i-1]*inv[i])%MOD
        
    def coef(x,y):
        num = (((fac[x+y]*invfac[y])%MOD)*invfac[x]%MOD)
        return num

    while M%2 == 0:
        d[2] += 1
        M //= 2
    f = 3
    while f ** 2 <= M:
        if M % f == 0:
            d[f] += 1
            M //= f
        else:
            f += 2
    if M != 1:
        d[M] += 1
    
    l = list(d.values())
    ans = 1
    for num in l:
        ans *= coef(num,N-1)
        ans %= MOD
        
    print(ans)
    
if __name__ == "__main__":
    main()
# Original solution
import sys
input = sys.stdin.buffer.readline
from collections import defaultdict
import copy

def main():
    N,M = list(map(int,input().split()))
    d = defaultdict(int)
    MOD = 10**9+7
    R = 10**5+100
    fac = [0 for _ in range(R+1)]
    fac[0],fac[1] = 1,1
    inv = copy.deepcopy(fac)
    invfac = copy.deepcopy(fac)
    
    for i in range(2,R+1):
        fac[i] = (fac[i-1]*i)%MOD
        inv[i] = MOD-(MOD//i)*inv[MOD%i]%MOD
        invfac[i] = (invfac[i-1]*inv[i])%MOD
        
    def coef(x,y):
        num = (((fac[x+y]*invfac[y])%MOD)*invfac[x]%MOD)
        return num

    while M%2 == 0:
        d[2] += 1
        M //= 2
    f = 3
    while f ** 2 <= M:
        if M % f == 0:
            d[f] += 1
            M //= f
        else:
            f += 2
    if M != 1:
        d[M] += 1
    
    l = list(d.values())
    ans = 1
    for num in l:
        ans *= coef(num,N-1)
        ans %= MOD
        
    print(ans)
    
if __name__ == "__main__":
    main()

# Optimized solution
import sys
input = sys.stdin.buffer.readline

def main():
    N,M = list(map(int,input().split()))
    MOD = 10**9+7
    
    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-n**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp //= i
                arr.append([i, cnt])

        if temp!=1:
            arr.append([temp, 1])

        return arr
        
    cl = factorization(M)
    
    def combinations(x,y,N):
        fac = [0]*(N+1)
        fac[0],fac[1] = 1,1
        
        for i in range(2,N+1):
            fac[i] = (fac[i-1]*i)%MOD
            
        return (fac[x+y]*pow(fac[x],MOD-2,MOD)*pow(fac[y],MOD-2,MOD))%MOD
        
    ans = 1
    for pr,num in cl:
        ans *= combinations(N-1,num,N+num)
        ans %= MOD
    
    print(ans)
    
if __name__ == "__main__":
    main()
# Original solution
import sys
input = sys.stdin.buffer.readline

def main():
	K,M = list(map(int,input().split()))
	
	def factorize(n):
		fct = []  # prime factor
		b, e = 2, 0  # base, exponent
		while b * b <= n:
			while n % b == 0:
				n = n // b
				e = e + 1
			if e > 0:
				fct.append((b, e))
			b, e = b + 1, 0
		if n > 1:
			fct.append((n, 1))
		return fct
	
	N = 10**6
	MOD = 10**9+7
	fac = [0]*(N+1)
	fac[0],fac[1] = 1,1
	invfac = [0]*(N+1)
	invfac[0],invfac[1] = 1,1

	for i in range(2,N+1):
		fac[i] = (fac[i-1]*i)%MOD

	invfac[-1] = pow(fac[-1],MOD-2,MOD)
	for i in range(N,0,-1):
		invfac[i-1] = (invfac[i]*i)%MOD

	def coef(x,y):
		num = ((fac[x]*invfac[y])%MOD)*invfac[x-y]%MOD
		return num
	
	fl = factorize(M)
	
	ans = 1
	for pr,cnt in fl:
	    ans *= coef(K+cnt-1,K-1)
	    ans %= MOD
	
	print(ans)
	
if __name__ == "__main__":
	main()


# Optimized solution
import sys
input = sys.stdin.buffer.readline

def main():
	K,M = list(map(int,input().split()))
	
	def factorize(n):
		fct = []  # prime factor
		b, e = 2, 0  # base, exponent
		while b * b <= n:
			while n % b == 0:
				n = n // b
				e = e + 1
			if e > 0:
				fct.append((b, e))
			b, e = b + 1, 0
		if n > 1:
			fct.append((n, 1))
		return fct
	
	N = 10**5+100
	MOD = 10**9+7
	fac = [0]*(N+1)
	fac[0],fac[1] = 1,1
	invfac = [0]*(N+1)
	invfac[0],invfac[1] = 1,1

	for i in range(2,N+1):
		fac[i] = (fac[i-1]*i)%MOD

	invfac[-1] = pow(fac[-1],MOD-2,MOD)
	for i in range(N,0,-1):
		invfac[i-1] = (invfac[i]*i)%MOD

	def coef(x,y):
		num = ((fac[x]*invfac[y])%MOD)*invfac[x-y]%MOD
		return num
	
	fl = factorize(M)
	
	ans = 1
	for pr,cnt in fl:
	    ans *= coef(K+cnt-1,K-1)
	    ans %= MOD
	
	print(ans)
	
if __name__ == "__main__":
	main()
# Original solution
N, M = [ int(it) for it in input().split() ]
MOD = 1000000007

import math
sM = int(math.sqrt(M)+1)

p_li = []
m = M
for i in range(sM):
  for j in range(2,sM+1):
    if (m%j)==0:
      p_li.append(j)
      m//=j
      break
  if (m==1):
    break
if (m!=1):
  p_li.append(m)
    
    
import collections
co = collections.Counter(p_li)
vec = list(co.values())

def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

s = 1
for v in vec:
  X=N-1+v
  Y=N-1
  if (X-Y<Y):
    Y=X-Y
  ss = 1
  sd = 1
  for i in range(X,X-Y,-1):
    ss = (ss*i)%MOD
  for i in range(Y,0,-1):
    sd = (sd*i)%MOD
  
  ss = (ss*mod_inv(sd,MOD))%MOD
  s = (s*ss)%MOD
print((s%MOD))
      




# Optimized solution
N, M = [ int(it) for it in input().split() ]
MOD = 1000000007

import math
sM = int(math.sqrt(M)+1)

p_li = []
m = M
for j in range(2,sM+1):
  for i in range(sM):
    if (m%j)==0:
      p_li.append(j)
      m//=j
    else:
      break
  if (m==1):
    break
if (m!=1):
  p_li.append(m)
    
    
import collections
co = collections.Counter(p_li)
vec = list(co.values())

def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

s = 1
for v in vec:
  X=N-1+v
  Y=N-1
  if (X-Y<Y):
    Y=X-Y
  ss = 1
  sd = 1
  for i in range(X,X-Y,-1):
    ss = (ss*i)%MOD
  for i in range(Y,0,-1):
    sd = (sd*i)%MOD
  
  ss = (ss*mod_inv(sd,MOD))%MOD
  s = (s*ss)%MOD
print((s%MOD))
# Original solution
import sys
import math
def input():
    return sys.stdin.readline()[:-1]

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def trial_division(n):
    factor = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    if n!=1:
        factor.append(n)
    return factor

n,m=list(map(int,input().split()))
mod=10**9+7
if m==1:
    print((1))
    quit()
li=trial_division(m)
tmp=li[0]
countli=[]
count=1
for i in range(1,len(li)):
    if tmp!=li[i]:
        countli.append(count)
        count=1
    else:
        count+=1
    tmp=li[i]
countli.append(count)
ans=1
for i in range(len(countli)):
    ans*=combinations_count(countli[i]+n-1,countli[i])
print((ans%mod))

# Optimized solution
import sys
import math
def input():
    return sys.stdin.readline()[:-1]

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def trial_division(n):
    factor = []
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    if n!=1:
        factor.append(n)
    return factor

n,m=list(map(int,input().split()))
mod=10**9+7
if m==1:
    print((1))
    quit()
li=trial_division(m)
tmp=li[0]
countli=[]
count=1
for i in range(1,len(li)):
    if tmp!=li[i]:
        countli.append(count)
        count=1
    else:
        count+=1
    tmp=li[i]
countli.append(count)
ans=1
for i in range(len(countli)):
    r=countli[i]
    s=n+r-1
    r=min(r,n-1)
    p=1
    for j in range(r):
        p*=s-j
        p//=j+1
    ans*=p
    ans%=mod
    
print((ans%mod))
# Original solution
from collections import Counter
def factorization(n) -> list:
	if n==1:
		return [1]
	ret = []
	i = 2
	while i*i<=n:
		while n%i==0:
			n //= i
			ret.append(i)
		i += 1
	if n!=1:
		ret.append(n)
	return ret

n,m = list(map(int,input().split()))
mod = 10**9+7
if m==1:
	print((1));exit()

factors = Counter(factorization(m))
mx = n+max(factors.values())

fac = [1]*(mx+1)
inv = [1]*(mx+1)
for i in range(1,mx+1):
	fac[i] = fac[i-1] * i % mod
inv[-1] = pow(fac[-1], mod - 2, mod)
for i in range(mx-1, -1, -1):
	inv[i] = inv[i+1] * (i+1) % mod
def cmb(n,r):
	assert n >= r >= 0
	return fac[n] * inv[n-r] * inv[r] % mod
	
ans=1
for v in list(factors.values()):
	ans*=cmb(n+v-1,v)
	ans%=mod

print(ans)

# Optimized solution
from collections import Counter
def factorization(n) -> list:
	if n==1:return [1]
	ret = []
	i = 2
	while i*i<=n:
		while n%i==0:
			n //= i
			ret.append(i)
		i += 1
	if n!=1:ret.append(n)
	return ret
	
from operator import mul
from functools import reduce
def cmb(n,r):
	if n < r:return 0
	r = min(n-r,r)
	if r==0:return 1
	u = reduce(mul, list(range(n, n-r, -1)))
	d = reduce(mul, list(range(1,r+1)))
	return u//d

def main():
	n,m = list(map(int,input().split()))
	mod = 10**9+7
	if m==1:
		print((1))
		exit()
	ans=1
	for v in list(Counter(factorization(m)).values()):
		ans*=cmb(n+v-1,v)
		ans%=mod
	print(ans)
	
if __name__=="__main__":main()
# Original solution
#coding utf-8
import math
N,M=list(map(int,input().split()))

def soinsu(m):
  fact =[]
  i = 2
  while i*i<=m:
    if m%i==0:
      fact.append(i)
      m //=i
    else:
      i +=1
  if m>1:
    fact.append(m)
  return fact

fact=soinsu(M)
counting=[]
for i in fact:
  counting.append(fact.count(i))
  del fact[:fact.count(i)-1]
  if fact==[]:
    break

def permi(n,r):
  return math.factorial(n)//math.factorial(n-r)
def combi(n,r):
  return permi(n,r)//math.factorial(r)

ans = 1
for i in counting:
  ans *=combi(i+N-1,N-1)

print((ans%(10**9+7)))

# Optimized solution
#coding utf-8
import math
from operator import mul
from functools import reduce
N,M=list(map(int,input().split()))

def soinsu(m):
  fact =[]
  i = 2
  while i*i<=m:
    if m%i==0:
      fact.append(i)
      m //=i
    else:
      i +=1
  if m>1:
    fact.append(m)
  return fact

fact=soinsu(M)
counting=[]
for i in fact:
  counting.append(fact.count(i))
  del fact[:fact.count(i)-1]
  if fact==[]:
    break

def combi(n,r):
  r =min(r,n-r)
  if r==0:
    return 1
  over = reduce(mul, list(range(n, n - r, -1)))
  under = reduce(mul, list(range(1, r + 1)))
  return over // under

ans = 1
for i in counting:
  ans *=combi(i+N-1,N-1)

print((ans%(10**9+7)))