CodeEff/ECCO huggingface dataset:
# Original solution
N,M = list(map(int,input().split()))
div =[]
for i in range(2,int(M**(1/2))+2):
    cur = 0
    while M%i==0:
        M = M//i
        cur += 1
    if cur >=1:
        div.append(cur)
if M>1: div.append(1)
div.sort()
mod = 10**9+7
frac = [1]*(N+50)
num = len(frac)
for i in range(len(frac)-1):
    frac[i+1] = frac[i]*(i+1)%mod
finv = [1] * (N+50)
finv[-1] = pow(frac[-1], mod-2, mod)
for i in range(1, num):
  finv[num-1-i] = finv[num-i] * (num-i) % mod
ans = 1
for i in div:
    ans = ans * frac[N+i-1]*finv[N-1]*finv[i]%mod
print(ans)

# Optimized solution
N,M = list(map(int,input().split()))
div = []
for i in range(2,int(M**(1/2))+2):
    cur = 0
    while M%i==0:
        M//=i
        cur += 1
    if cur >=1:
        div.append(cur)
if M>1:div.append(1)
div.sort()
mod = 10**9+7
frac = [1]*(N+50)
num=len(frac)
for i in range(num-1):
    frac[i+1] = frac[i]*(i+1)%mod
finv = [1]*(N+50)
finv[-1] = pow(frac[-1],mod-2,mod)
ans = 1
for i in range(1,num):
    finv[num-1-i] = finv[num-i]*(num-i)%mod
for i in div:
    ans  =ans*frac[N+i-1]*finv[N-1]*finv[i]%mod
print(ans)
# Original solution
mod = 10**9 + 7

def factorize(n):
    # http://nihaoshijie.hatenadiary.jp/entry/2018/02/03/115759
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append(e)
        b, e = b + 1, 0
    if n > 1:
        fct.append(1)
    return fct

class COMB_MOD():
    # http://drken1215.hatenablog.com/entry/2018/06/08/210000
    def __init__(self, max_n=510000, mod=10**9+7):
        self.fac = [0]*max_n
        self.finv = [0]*max_n
        self.inv = [0]*max_n
        self.fac[0] = self.fac[1] = 1
        self.finv[0] = self.finv[1] = 1
        self.inv[1] = 1
        self.max = max_n
        self.mod = mod
        self._maesyori()

    def _maesyori(self):
        for i in range(2,self.max):
            self.fac[i] = self.fac[i-1] * i % self.mod
            self.inv[i] = self.mod - self.inv[self.mod % i] * (self.mod // i) % self.mod
            self.finv[i] = self.finv[i-1] * self.inv[i] % self.mod

    def COM(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.mod) % self.mod

n, m = list(map(int,input().split()))
fct = factorize(m)
ans = 1
COM = COMB_MOD()
for cnt in fct:
    ans = ans*COM.COM(cnt+n-1, cnt) % mod
print(ans)

# Optimized solution
from collections import Counter
mod = 10**9 + 7
n, m = list(map(int, input().split()))

def fact(m):
    c = Counter()
    s = 2
    while s**2 <= m:
        if m % s:
            s += 1
            continue
        while m % s == 0:
            c[s] += 1
            m //= s
    if m > 1:
        c[m] += 1
    return c

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

ans = 1
for cnt in list(fact(m).values()):
    ans = ans*comb(cnt+n-1, cnt) % mod
#    for i in range(cnt):
#        ans = ans*(cnt+n-1-i)//(i+1)
print((ans % mod))
# Original solution
N, M = [int(_) for _ in input().split()]

MOD = 10**9+7

def primes(n):
    from math import sqrt
    mn = int(sqrt(n)) + 2
    p = [1] * mn
    for x in range(2, mn):
        if p[x]:
            y = x * x
            while y < mn:
                p[y] = 0
                y += x
    return (i for i in range(2, mn) if p[i])

def calc(M):
    result = {}
    for n in primes(M):
        if M % n == 0:
            result[n] = 1
            M //= n
        while M % n == 0:
            result[n] += 1
            M //= n
    if M > 1:
        result[M] = 1
    return result

def C(x, y):
    n = min(y, x - y)
    r = 1
    for i in range(n):
        r = r * (x - i)
    for i in range(n):
        r = r // (i + 1)
    return r

cs = calc(M)

result = 1

for x in list(cs.values()):
    result = result * C(N+x-1, N-1) % MOD

print(result)


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

MOD = 10**9+7

def factorize(n):
    from math import sqrt
    m = int(sqrt(n)) + 1
    p = [True] * m
    result = {}
    for x in range(2, m):
        if p[x]:
            p[x * 2::x] = [False] * ((m - 1) // x - 1)
            i = 0
            while 1:
                d, q = divmod(n, x)
                if q == 0:
                    n = d
                    i += 1
                    result[x] = i
                else:
                    break
    if n > 1:
        result[n] = 1
    return result

def C(x, y):
    r = 1
    s = 1
    for i in range(y):
        r *= (x - i)
    for i in range(y):
        s *= (i + 1)
    return (r // s) % MOD

result = 1

for x in list(factorize(M).values()):
    result = result * C(N + x - 1, x) % MOD

print(result)
# Original solution
import math

def prime_factorize(n):
    ret = []
    # 小さい素数から順に試し割りしていく
    for i in range(2, int(math.sqrt(n))+1):
        if n % i != 0:
            continue
        e = 0
        while n % i == 0:
            e += 1
            n //= i
        ret += [(i, e)]

    if n != 1:
        ret += [(n, 1)]

    return ret


def extgcd(a, b):
    x,y, u,v = 0,1, 1,0
    while a != 0:
        q, r = b//a, b%a
        m, n = x-u*q, y-v*q
        b,a, x,y, u,v = a,r, u,v, m,n
        g = b
    return x, y, g


def modinv(a, m):
    x, y, g = extgcd(a, m)
    if g != 1:
        print ("[+]Inverse does not exist.")
    else:
        return ((m + x) % m) % m


def mod_comb(n, r, mod):
    ans_mul, ans_div = 1, 1

    for i in range(r):
        ans_mul *= (n-i)
        ans_div *= (i+1)
        ans_mul %= mod
        ans_div %= mod

    return ans_mul * modinv(ans_div, mod) % mod


def main():
    N, M = list(map(int, input().split()))
    v = prime_factorize(M)
    MOD = int(10**9+7)
    ans = 1

    for i in v:
        ans *= mod_comb(N+i[1]-1, i[1], MOD)
        ans %= MOD
    print (ans)

main()


# Optimized solution
def prime_factor(n):
    ret, p = {}, 2
    while p*p <= n:
        while n % p == 0:
            ret[p] = ret.get(p, 0) + 1
            n //= p
        p += 1
    if n != 1: ret[n] = 1
    return ret


def mod_inverse(x, mod):
    return pow(x, mod-2, mod)


def mod_comb(n, k, mod):
    numer, denom = 1, 1
    for i in range(k):
        numer = numer * ((n-i) % mod) % mod
        denom = denom * ((i+1) % mod) % mod

    return numer * mod_inverse(denom, mod) % mod


def main():
    n, m = list(map(int, input().split()))
    prime = prime_factor(m)
    mod = 1000000007
    ans = 1
    for (p, e) in list(prime.items()):
        ans = ans * mod_comb(n+e-1, e, mod) % mod

    print(ans)

main()
# Original solution
import math
N, M = list(map(int, input().split()))


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])

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

    return arr


mod = 10**9 + 7


def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, 2*10**5 + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod//i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


primes = factorization(M)
# 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））

ans = 1

for p, cnt in primes:
    tmp = cmb(N+cnt-1, N-1, mod)
    ans *= tmp
    ans %= mod

print(ans)


# Optimized solution
def main():
    N, M = list(map(int, input().split()))

    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])

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

        return arr

    mod = 10**9 + 7

    def cmb(n, r, mod):
        if (r < 0 or r > n):
            return 0
        r = min(r, n-r)
        return g1[n] * g2[r] * g2[n-r] % mod

    g1 = [1, 1]
    g2 = [1, 1]
    inverse = [0, 1]
    for i in range(2, N+100 + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)

    primes = factorization(M)
    # 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））

    ans = 1

    for p, cnt in primes:
        tmp = cmb(N+cnt-1, N-1, mod)
        ans *= tmp
        ans %= mod

    print(ans)


main()
# Original solution
n, m = list(map(int, input().split()))
mod = 1000000007
d = 1
divisor = []
while d * d <= m:
    if m % d == 0:
        divisor.append(d)
        if d != m // d:
            divisor.append(m // d)
    d += 1
divisor = sorted(divisor)
l = len(divisor)
matrix = [[0] * l for _ in range(l)]
for i in range(l):
    for j in range(l):
        matrix[i][j] = 1 if divisor[i] % divisor[j] == 0 else 0

dp = [1] * l
t = n - 1
while t > 0:
    if t % 2 == 1:
        newdp = [0] * l
        for i in range(l):
            for j in range(l):
                newdp[i] = (newdp[i] + matrix[i][j] * dp[j]) % mod
        dp = newdp
    newmatrix = [[0] * l for _ in range(l)]
    for i in range(l):
        for j in range(i + 1):
            newmatrix[i][j] = sum(matrix[i][k] * matrix[k][j] for k in range(j, i + 1)) % mod
    matrix = newmatrix
    t //= 2

print((dp[-1]))


# Optimized solution
n, m = list(map(int, input().split()))
mod = 1000000007

def cmb(n, k):
    ret = 1
    for i in range(k):
        ret *=  n - i
        ret //= i + 1
    return ret % mod

primes = [2]
for p in range(3, 1000):
    if all(p % q for q in primes):
        primes.append(p)

ret = 1
for p in primes:
    q = 0
    while m % p == 0:
        m //= p
        q += 1
    if q > 0:
        ret = (ret * cmb(n + q - 1, q)) % mod
if m > 1:
    ret = (ret * cmb(n, 1)) % mod

print(ret)
# Original solution
import sys
sys.setrecursionlimit(100000)

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

MOD = 10 ** 9 + 7

if m == 1:
    print('1')
    exit()

factor = []
temp = 0
x = 2
while m > 1:
    if m % x == 0:
        m //= x
        temp += 1
    elif temp > 0:
        factor.append(temp)
        temp = 0
        x += 1
    else:
        x += 1
factor.append(temp)

nCr = {}
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;
    if (n, r) in nCr: return nCr[(n, r)]

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p;
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    nCr[(n, r)] = result
    return result;

ans = 1
for x in factor:
    ans *= cmb(x + n - 1, n - 1)
    ans %= MOD

print(ans)

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

MOD = 10 ** 9 + 7

if m == 1:
    print('1')
    exit()

factor = []
temp = 0
x = 2
while m > 1:
    if m % x == 0:
        m //= x
        temp += 1
    elif temp > 0:
        factor.append(temp)
        temp = 0
        x += 1
    else:
        x += 1
factor.append(temp)

nCr = {}
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;
    if (n, r) in nCr: return nCr[(n, r)]

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p;
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    nCr[(n, r)] = result
    return result;

ans = 1
for x in factor:
    ans *= cmb(x + n - 1, n - 1)
    ans %= MOD

print(ans)
# Original solution
import math

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


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

l = [2]
now = 3

while now ** 2 <= M:
    flag = True
    for i in l:
        if now % i == 0:
            flag = False
            break
    if flag:
        l.append(now)
    now += 2

dic = {}
for i in l:

    while M % i == 0:
        if i not in dic:
            dic[i] = 1
        else:
            dic[i] += 1

        M //= i

if M != 1:
    dic[M] = 1

ans = 1
#print (dic)

for i in dic:
    ans *= nCr(dic[i] + N - 1,dic[i])
    #print (ans)
    ans %= (10 ** 9 + 7)
print((ans % (10**9+7)))


# Optimized solution
import sys
mod = 1000000007

def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y//2)**2 % mod
    else            : return power(x, y//2)**2 * x % mod

def div(a, b):
    return mul(a, pow(b, mod-2,mod))

ivl = [0]
def inverse_max(a): #下2つを使用する際の下準備

    now = 1
    for i in range(a):
        i += 1
        now *= i
        now %= mod
        ivl.append(now)

def nCr(n,r):
    return div(ivl[n] , mul(ivl[n-r] , ivl[r]))


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

if N == 1:
    print((1))
    sys.exit()

l = [2]
now = 3

while now ** 2 <= M:
    flag = True
    for i in l:
        if now % i == 0:
            flag = False
            break
    if flag:
        l.append(now)
    now += 2

dic = {}
for i in l:

    while M % i == 0:
        if i not in dic:
            dic[i] = 1
        else:
            dic[i] += 1

        M //= i

if M != 1:
    dic[M] = 1

ans = 1
#print (dic)

for i in dic:
    ans *= nCr(dic[i] + N - 1,dic[i])
    #print (ans)
    ans %= (10 ** 9 + 7)
print((ans % (10**9+7)))
# Original solution
import math
import collections

Max = 210000
Mod = 1000000007
fac = [0] * Max
finv = [0] * Max
inv = [0] * Max
def COMinit():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, Max):
        fac[i] = fac[i-1] * i % Mod 
        inv[i] = Mod - inv[Mod%i] * (Mod//i) % Mod
        finv[i] = finv[i-1] * inv[i] % Mod 

def COM(n, k):
    if n < 0 or k < 0 or n < k:
        return 0
    return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod

N, M = list(map(int, input().split()))
prime_count = collections.Counter()
for i in range(2, math.ceil(math.sqrt(M))+1):
    while M % i == 0:
        M /= i
        prime_count[i] += 1
if M > 1:
    prime_count[M] += 1

ans = 1
COMinit()
for i, b in list(prime_count.items()):
    tmp = COM(b+N-1, N-1)
    ans = (ans * tmp) % Mod 
print(ans)


# Optimized solution
import math
import collections

Mod = 1000000007
fac = [1, 1]
finv = [1, 1]
inv = [0, 1]
def COMinit():
    for i in range(2, N+111):
        fac.append(fac[-1]*i%Mod)
        inv.append((-inv[Mod%i] * (Mod//i)) % Mod)
        finv.append(finv[-1] * inv[-1] % Mod)
    

def COM(n, k):
    if n < 0 or k < 0 or n < k:
        return 0
    return fac[n] * (finv[k] * finv[n-k] % Mod) % Mod

N, M = list(map(int, input().split()))
prime_count = collections.Counter()
for i in range(2, math.ceil(math.sqrt(M))+1):
    while M % i == 0:
        M /= i
        prime_count[i] += 1
if M > 1:
    prime_count[M] += 1

ans = 1
COMinit()
for i, b in list(prime_count.items()):
    tmp = COM(b+N-1, N-1)
    ans = (ans * tmp) % Mod 
print(ans)
# Original solution
import math
from collections import Counter

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

prime_count = Counter()
for i in range(2, math.ceil(math.sqrt(m))+1):
    while m % i == 0:
        m /= i
        prime_count[i] += 1
if m > 1:
    prime_count[int(m)] += 1    

def ncr(n, r, p):
    num = den = 1
    for i in range(r):
        num = (num * (n - i)) % p
        den = (den * (i + 1)) % p
    return (num * pow(den, p - 2, p)) % p

ans = 1
for p, q in list(prime_count.items()):
    ans *= ncr(q+n-1, n-1, mod)
    ans %= mod
print(ans)

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

prime_count = Counter()
for i in range(2, math.ceil(math.sqrt(m))+1):
    while m % i == 0:
        m /= i
        prime_count[i] += 1
if m > 1:
    prime_count[int(m)] += 1    

def ncr(n, r, p):
    num = den = 1
    for i in range(r):
        num = (num * (n - i)) % p
        den = (den * (i + 1)) % p
    return (num * pow(den, p - 2, p)) % p
p=10**9+7 

ans = 1 
for k, v in list(prime_count.items()):
    ans *= ncr(n-1+v, n-1, p)
    ans %= p
print(ans)
# Original solution
import math
from collections import Counter
n, m = list(map(int, input().split()))

prime_count = Counter()
for i in range(2, math.ceil(math.sqrt(m))+1):
    while m % i == 0:
        m /= i
        prime_count[i] += 1
if m > 1:
    prime_count[int(m)] += 1    

def ncr(n, r, p):
    num = den = 1
    for i in range(r):
        num = (num * (n - i)) % p
        den = (den * (i + 1)) % p
    return (num * pow(den, p - 2, p)) % p
p=10**9+7 

ans = 1 
for k, v in list(prime_count.items()):
    ans *= ncr(n-1+v, n-1, p)
    ans %= p
print(ans)

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

prime_count = Counter()
for i in range(2, math.ceil(math.sqrt(m))+1):
    while m % i == 0:
        m /= i
        prime_count[i] += 1
if m > 1:
    prime_count[int(m)] += 1

def ncr(n, r, p):
    num = den = 1
    for i in range(r):
        num = (num * (n - i)) % p
        den = (den * (i + 1)) % p
    return (num * pow(den, p - 2, p)) % p
p=10**9+7 

ans = 1
for k, v in list(prime_count.items()):
    ans *= ncr(v+n-1, v, p)
    ans %= p

print(ans)
# Original solution
n,m=list(map(int,input().split()))
i=2
s=[]
while 1<m:
  j=0
  while m % (i**(j+1))==0:
    j+=1
  if j:
    m//=i**j
    s+=[j]
  i+=1
a=1
for v in s:
  c = 1
  for i in range(v):
    c = c * (n+i) // (1+i)
  a = a * c % (10**9+7)
print(a)


# Optimized solution
n,m=list(map(int,input().split()))
i=2
s=[]
while i*i<=m:
  j=0
  while m % i == 0:
    m//=i
    j+=1 
  if j:
    s+=[j]
  i+=1
a=1
if m > 1:
  s+=[1]
  
for v in s:
  c = 1
  for i in range(v):
    c = c * (n+i) // (1+i)
  a = a * c % (10**9+7)
print(a)
# Original solution
import math
N,M = list(map(int,input().split(" ")))
MOD = 10 ** 9 + 7
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

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

ans = 1
fac = factorize(M)
for temp in fac:
    num = temp[1]
    ans *= combinations_count(num + N - 1,N-1)
    ans %= MOD
print(ans)


# Optimized solution
import math
N,M = list(map(int,input().split(" ")))
MOD = 10 ** 9 + 7
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


def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k]) % MOD

    return result % MOD

ans = 1
fac = factorize(M)
for temp in fac:
    num = temp[1]
    ans *= cmb(num + N - 1,num)
    ans %= MOD
print(ans)
# Original solution
n,m=list(map(int,input().split()))
import math
sosuu=[]
m0=m
i=2
while i**2<=m:
    if m0%i==0:
        sosuu.append(0)
    while m0%i==0:  
        m0=m0//i
        sosuu[-1]=sosuu[-1]+1
    i=i+1
if m0>1:
    sosuu.append(1)
def c(n,r):
    return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))
answer=1
for i in sosuu:
    a=c(i+n-1,i)
    answer=(answer*a)%(10**9+7)
print(answer)



# Optimized solution
n,M=list(map(int,input().split()))
from math import factorial
i=2
c_list=[]
m=M
while not m==1:
    count=0
    while m%i==0:
        m=m//i
        count=count+1
    if not count==0:
        c_list.append(count)
    i=i+1
if M==1:
    print((1))
else:
    INF=10**9+7
    Sum=1
    for i in c_list:
        Sum=Sum*(factorial(n-1+i)//(factorial(n-1)*factorial(i)))
        Sum=Sum%INF
    print(Sum)
# Original solution
n,M=list(map(int,input().split()))
from math import factorial
i=2
c_list=[]
m=M
while i**2<=M:
    count=0
    while m%i==0:
        m=m//i
        count=count+1
    if not count==0:
        c_list.append(count)
    i=i+1
if not m==1:
    c_list.append(1)
if M==1:
    print((1))
else:
    INF=10**9+7
    Sum=1
    for i in c_list:
        Sum=Sum*(factorial(n-1+i)//(factorial(n-1)*factorial(i)))
        Sum=Sum%INF
    print(Sum)


# Optimized solution
n,M=list(map(int,input().split()))
i=2
c_list=[]
m=M
while i**2<=M:
    count=0
    while m%i==0:
        m=m//i
        count=count+1
    if not count==0:
        c_list.append(count)
    i=i+1
if not m==1:
    c_list.append(1)
def comb(x,y):
    a=1
    for i in range(x-y+1,x+1):
        a=a*i
    b=1
    for i in range(1,y+1):
        b=b*i
    return a//b
if M==1:
    print((1))
else:
    INF=10**9+7
    Sum=1
    for i in c_list:
        Sum=Sum*comb(i+n-1,i)
        Sum=Sum%INF
    print(Sum)
# Original solution
iN,iM = [int(x) for x in input().split()]
iD = 10**9 +7 #法

def fPrimeCounter(iM):
    i = 2
    iS = int(iM ** 0.5) + 1
    aRet = []
    while i < iS or iM != 1:
        iCounter = 0
        while iM % i == 0:
            iM = iM // i
            iCounter += 1
        if 0 < iCounter : aRet.append(iCounter)
        i += 1

    return aRet

#二分累乗法 iDを法として
def fBiPow(iX,iN,iD):
    iY = 1
    while iN > 0:
        if iN % 2 == 0:
            iX = iX * iX % iD
            iN = iN // 2
        else:
            iY = iX * iY % iD
            iN = iN - 1
    return iY

aP = fPrimeCounter(iM)
if aP == [] :
    print((1))
else:
    iMax = max(aP) + iN - 1
    aM = [1] * (iMax + 1)
    #階乗 iD を法とした
    for i in range(1,iMax + 1):
        aM[i] = aM[i-1] * i  % iD
    aInvM = [1]* (iMax + 1)
    aInvM[iMax] = fBiPow(aM[iMax],iD-2,iD)
    #階乗の逆元 iD を法とした
    for i in range(iMax,0,-1):
        aInvM[i-1] = aInvM[i]*i % iD

    iRet = 1
    for i in aP:
        # i + iN -1  C  iN -1
        iRet *= aM[i+iN-1] * aInvM[iN-1] * aInvM[i] % iD
    iRet %= iD
    print(iRet)


# Optimized solution

iN,iM = [int(x) for x in input().split()]
iD = 10**9 +7 #法

def fPrimeCounter(iM):
    iS = int(iM ** 0.5) + 1
    aRet = []
    for i in range(2,iS + 1):
        iCounter = 0
        while iM % i == 0:
            iM = iM / i
            iCounter += 1
        if 0 < iCounter : aRet.append(iCounter)
        if iM == 1 : break
    if 1 < iM  : aRet.append(1)
    return aRet

#二分累乗法 iDを法として
def fBiPow(iX,iN,iD):
    iY = 1
    while iN > 0:
        if iN % 2 == 0:
            iX = iX * iX % iD
            iN = iN // 2
        else:
            iY = iX * iY % iD
            iN = iN - 1
    return iY

aP = fPrimeCounter(iM)
if len(aP) == 0:
    print((1))
    exit()
iMax = max(aP) + iN - 1
aM = [1] * (iMax + 1)
#階乗 iD を法とした
for i in range(1,iMax + 1):
    aM[i] = aM[i-1] * i  % iD
aInvM = [1]* (iMax + 1)
aInvM[iMax] = fBiPow(aM[iMax],iD-2,iD)
#階乗の逆元 iD を法とした
for i in range(iMax,0,-1):
    aInvM[i-1] = aInvM[i]*i % iD

iRet = 1
for i in aP:
    # i + iN -1  C  iN -1
    iRet *= aM[i+iN-1] * aInvM[iN-1] * aInvM[i] % iD
iRet %= iD
print(iRet)