CodeEff/ECCO huggingface dataset:
# Original solution
from collections import Counter
from math import sqrt

#f_listとf_r_listの要素数は状況に応じて変えよう

MOD = (10 ** 9) + 7

list_size = 3 * (10 ** 5)

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

def power(n, x):
	if x == 1:
		return n
	elif x % 2 == 0:
		return power(int((n * n) % MOD), int(x / 2))
	else:
		return int((n * power(n, x - 1)) % MOD)

f_r_list[-1] = power(f_list[-1], MOD - 2)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)

def comb(n, r):
	if n < r:
		return 0
	elif n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD 

#prime = [2]

def is_prime(i):
	if i == 1:
		return False
	#global prime
	for j in range(2, int(sqrt(i)) + 1):
		if i % j == 0:
			return False
	return True

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

for i in range(2, int(sqrt(m)) + 1):
	if m % i == 0:
		prime_factor[i] += 1
		m = m // i
		while m % i == 0:
			prime_factor[i] += 1
			m = m // i
	if is_prime(m):
		prime_factor[m] += 1
		break

ans = 1
for i in list(prime_factor.values()):
	ans *= comb(n + i - 1, i)
	ans %= MOD
print(ans)



# Optimized solution
from collections import Counter
from math import sqrt

#f_listとf_r_listの要素数は状況に応じて変えよう

MOD = (10 ** 9) + 7

list_size = 3 * (10 ** 5)

f_list = [1] * list_size
f_r_list = [1] * list_size

for i in range(list_size - 1):
	f_list[i + 1] = int((f_list[i] * (i + 2)) % MOD)

def power(n, x):
	if x == 1:
		return n
	elif x % 2 == 0:
		return power(int((n * n) % MOD), int(x / 2))
	else:
		return int((n * power(n, x - 1)) % MOD)

f_r_list[-1] = power(f_list[-1], MOD - 2)

for i in range(2, list_size + 1):
	f_r_list[-i] = int((f_r_list[-i + 1] * (list_size + 2 - i)) % MOD)

def comb(n, r):
	if n < r:
		return 0
	elif n == 0 or r == 0 or n == r:
		return 1
	else:
		return (((f_list[n - 1] * f_r_list[n - r - 1]) % MOD) * f_r_list[r - 1]) % MOD 

def is_prime(i):
	if i == 1:
		return False
	for j in range(2, int(sqrt(i)) + 1):
		if i % j == 0:
			return False
	return True

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

for i in range(2, int(sqrt(m)) + 1):
	if m % i == 0:
		prime_factor[i] += 1
		m = m // i
		while m % i == 0:
			prime_factor[i] += 1
			m = m // i
	if is_prime(m):
		prime_factor[m] += 1
		break

ans = 1
for i in list(prime_factor.values()):
	ans *= comb(n + i - 1, i)
	ans %= MOD
print(ans)
# Original solution
from math import floor, sqrt
from collections import defaultdict
def factors(n):
    d = defaultdict(int)
    for i in range(2,floor(sqrt(n))+1):
        while n % i == 0:
            n //= i
            d[i] += 1
        if n == 1:
            break
    if n != 1:
        d[n] += 1
    return d
def inv(x, mod):
    k = mod - 2
    ret = 1
    while k > 0:
        if k&1:
            ret = (ret*x) % mod
        x = (x*x) % mod
        k >>= 1
    return ret
N, M = list(map(int,input().split()))
mod = 10**9+7
dic = factors(M)
K = len(dic)
SIZE = N+max(dic.values()) if list(dic.values()) else N
fact = [None]*(SIZE+1)
finv = [None]*(SIZE+1)
fact[0] = 1
for i in range(1,SIZE+1):
    fact[i] = (fact[i-1]*i) % mod
finv[SIZE] = inv(fact[SIZE], mod=mod)
for i in range(SIZE, 0, -1):
    finv[i-1] = (finv[i]*i) % mod
def comb(n,k):
    tmp = (finv[k]*finv[n-k]) % mod
    return (fact[n]*tmp) % mod
ans = 1
for p in dic:
    ans = (ans*comb(dic[p]+N-1, dic[p])) % mod
print(ans)

# Optimized solution
from math import floor, sqrt
from collections import defaultdict
N,M = list(map(int,input().split()))
d = defaultdict(int)
for i in range(2, floor(sqrt(M))+1):
    while M % i == 0:
        d[i] += 1
        M //= i
if M != 1:
    d[M] += 1
def comb(n,k):
    if k == 0:
        return 1
    return comb(n-1,k-1) * n // k
ans = 1
for e in list(d.values()):
    ans *= comb(N+e-1, e)
print((ans % (10**9+7)))
# Original solution
# 素数リスト生成
def sieve(x):
    if x < 2: return []
    primes = [i for i in range(x)]
    primes[1] = 0
    for p in primes:
        if p > x ** (1/2): break
        if p == 0: continue
        for np in range(2 * p, x, p): primes[np] = 0
    return [p for p in primes if p != 0]

PS = sieve(10**7)

# 素因数分解
def factorint(x):
  d = {}
  for k in PS:
    if(x % k== 0):
      m = 1
      while(x % (k**m) == 0):
        m += 1
      d[k] = m - 1
      x = x / (k ** (m - 1))
      if x == 1:
        break
  return d

n, m = list(map(int, input().split()))
f = factorint(m)
idx = [i for i in list(f.values())]

def fact(n):
  ret = 1
  for i in range(1, n + 1):
    ret *= i
  return ret
def com(n, r):
  if n - r < r: r = n - r
  ret = 1
  for i in range(n-r+1, n+1):
    ret *= i
  for j in range(1, r+1):
    ret //= j
  return ret

ans = 1
for i in range(len(idx)):
  ans *= com(idx[i] + n - 1, n - 1) % (10 ** 9 + 7)

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

# Optimized solution
# 素数リスト生成
def sieve(x):
    if x < 2: return []
    primes = [i for i in range(x)]
    primes[1] = 0
    for p in primes:
        if p > x ** (1/2): break
        if p == 0: continue
        for np in range(2 * p, x, p): primes[np] = 0
    return [p for p in primes if p != 0]

PS = sieve(10**6)

# 素因数分解
def factorint(x):
  d = {}
  for k in PS:
    if(x % k== 0):
      m = 1
      while(x % (k**m) == 0):
        m += 1
      d[k] = m - 1
      x = x / (k ** (m - 1))
      if x == 1:
        break
  return d

n, m = list(map(int, input().split()))
f = factorint(m)
idx = [i for i in list(f.values())]
# 10^6より大きい素因数があったときの処理
re = 1
for k, v in list(f.items()):
  re *= k**v
if m // re != 1:
  idx.append(1)


def fact(n):
  ret = 1
  for i in range(1, n + 1):
    ret *= i
  return ret
def com(n, r):
  if n - r < r: r = n - r
  ret = 1
  for i in range(n-r+1, n+1):
    ret *= i
  for j in range(1, r+1):
    ret //= j
  return ret

ans = 1
for i in range(len(idx)):
  ans *= com(idx[i] + n - 1, n - 1) % (10 ** 9 + 7)

  
print((ans % (10 ** 9 + 7)))
# Original solution
import sys

MOD = 10 ** 9 + 7

def make_table(size=10**6, p=MOD):
    fac = [None] * (size + 1)
    fac[0] = 1
    for i in range(size):
        fac[i+1] = fac[i] * (i + 1) % p
    ifac = [None] * (size + 1)
    ifac[size] = pow(fac[size], p-2, p)
    for i in range(size, 0, -1):
        ifac[i-1] = ifac[i] * i % p
    return fac, ifac

fac, ifac = make_table()

def comb(n, r, mod=MOD):
    if r > n or r < 0:
        return 0
    return fac[n] * ifac[r] % mod * ifac[n-r] % mod

from collections import defaultdict
from math import floor, sqrt
def prime_factorize(n):
    res = defaultdict(int)
    while n % 2 == 0:
        res[2] += 1
        n //= 2
    if n == 1:
        return res
    for i in range(3, floor(sqrt(n))+1, 2):
        while n % i == 0:
            res[i] += 1
            n //= i
        if n == 1:
            return res
    res[n] += 1
    return res

n, m = list(map(int, sys.stdin.readline().split()))

def main():
    pfacts = prime_factorize(m)
    res = 1
    for v in list(pfacts.values()):
        res *= comb(n-1+v, v)
        res %= MOD
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

# Optimized solution
import sys

MOD = 10 ** 9 + 7

def make_table(size=10**6, p=MOD):
    fac = [None] * (size + 1)
    fac[0] = 1
    for i in range(size):
        fac[i+1] = fac[i] * (i + 1) % p
    ifac = [None] * (size + 1)
    ifac[size] = pow(fac[size], p-2, p)
    for i in range(size, 0, -1):
        ifac[i-1] = ifac[i] * i % p
    return fac, ifac

fac, ifac = make_table(10**5+30)

def comb(n, r, mod=MOD):
    if r > n or r < 0:
        return 0
    return fac[n] * ifac[r] % mod * ifac[n-r] % mod

from collections import defaultdict
from math import floor, sqrt
def prime_factorize(n):
    res = defaultdict(int)
    while n % 2 == 0:
        res[2] += 1
        n //= 2
    if n == 1:
        return res
    for i in range(3, floor(sqrt(n))+1, 2):
        while n % i == 0:
            res[i] += 1
            n //= i
        if n == 1:
            return res
    res[n] += 1
    return res

n, m = list(map(int, sys.stdin.readline().split()))

def main():
    pfacts = prime_factorize(m)
    res = 1
    for v in list(pfacts.values()):
        res *= comb(n-1+v, v)
        res %= MOD
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)
# Original solution
import math

n, m=list(map(int, input().split()))
t = {}
a = int(math.sqrt(m))

s=0

line = [2, 3] + [i%2*2 + i//2 * 6 + 5 for i in range(a//3)]
while s==0:
    for i in line:
        cnt = 0
        while m%i==0:
            m=m//i
            cnt += 1

        if cnt>0:
            t[i]=cnt

        if m==1:
            s=1
            break

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

out=1
for tk in list(t.keys()):
    out *= combi(t[tk]+n-1, n-1)
print((out%(1000000007)))

# Optimized solution
import math

n, m=list(map(int, input().split()))
t = {}
a = int(math.sqrt(m))

s=0

line = [2, 3] + [i%2*2 + i//2 * 6 + 5 for i in range(a)]
# line = [2] + list(range(3, m+2, 2))

for i in line:
# for i in range(2, m+2, 2):
#     print(i)
    cnt = 0
    while m%i==0:
        m=m//i
        cnt += 1

    if cnt>0:
        t[i]=cnt

    if m==1:
        break

if m!=1:
    t[m]=1

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

out=1
for tk in list(t.keys()):
    out *= combi(t[tk]+n-1, n-1)
#     out = out%(1000000007)
print((out%(1000000007)))
# Original solution
import math
N, M = list(map(int, input().split()))
MOD = 10 ** 9 + 7

def factoring(k): #kを因数分解し、素因数とその個数を辞書に入れて返す。
    dic = dict()
    n = int(math.sqrt(k))+2
    for i in range(2, n):
        count = 0
        while k%i == 0:
            count += 1
            k = k//i
        if count != 0:
            dic[i] = count
    if k != 1:
        dic[k] = 1
    return dic

def conbination(n, r): #nCrを求める
    # nCr = n! //(r! * (n-r)!)
    import math
    return (math.factorial(n) //(math.factorial(r) * math.factorial(n-r)))%MOD
dic = factoring(M)
ans = 1
for i in dic:
    ans = (ans * conbination(dic[i]+N-1, dic[i]))%MOD
print (ans)

    



# Optimized solution
MOD = 10 ** 9 + 7

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

def factoring(k): #kを因数分解し、素因数とその個数を辞書に入れて返す。
    import math
    dic = dict()
    n = int(math.sqrt(k))+2
    for i in range(2, n):
        count = 0
        while k%i == 0:
            count += 1
            k = k//i
        if count != 0:
            dic[i] = count
    if k != 1: #sqrt(k)までチェックしてもkが1になっていない --> kが素因数
        dic[k] = 1
    return dic

class Factorial:
    def __init__(self, n, mod):
        self.f = [1]
        self.mod = mod
        for j in range(1, n + 1):
            self.f.append(self.f[-1] * j % mod)
        self.i = [pow(self.f[-1], mod - 2, mod)]
        for j in range(n, 0, -1):
            self.i.append(self.i[-1] * j % mod)
        self.i.reverse()
    def factorial(self, j):
        return self.f[j]
    def ifactorial(self, j):
        return self.i[j]
    def comb(self, n, k):
        return self.f[n] * self.i[n - k] % self.mod * self.i[k] % self.mod if n >= k else 0




C = Factorial(N + 100, MOD).comb

ans = 1
dic = factoring(M)
for tmp in dic:
    # print (tmp, dic[tmp])
    ans *= C(dic[tmp] + N - 1, dic[tmp])
    ans %= MOD

print (ans)
# Original solution
import math
from collections import defaultdict

n, m = [int(i) for i in input().split()]

A = defaultdict(int)
p = 10 ** 9 + 7

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

def fact(n, p=10**9 + 7):
    f = [1]
    for i in range(1, n+1):
        f.append(f[-1]*i%p)
    return f

def invfact(n, f, p=10**9 + 7):
    inv = [pow(f[n], p-2, p)]
    for i in range(n, 0, -1):
        inv.append(inv[-1]*i%p)
    return inv[::-1]

f = fact(30+10**5)
invf = invfact(30+10**5, f)

def comb(a, b):
    return f[a] * invf[b] * invf[a-b] % p

i = 2

while m != 1 and i <= math.sqrt(m) + 1:
    while m % i == 0:
        m //= i
        A[i] += 1
    i += 1

if not A:
    print(n)
    exit()

if m != 1:
    A[m] = 1

n -= 1
ans = 1

for v in list(A.values()):
    ans *= comb(v+n, n)
    ans %= p

print(ans)

# Optimized solution
from math import sqrt
from collections import defaultdict

n, m = [int(i) for i in input().split()]

A = defaultdict(int)
p = 10 ** 9 + 7

def fact(n, p=10**9 + 7):
    f = [1]
    for i in range(1, n+1):
        f.append(f[-1]*i%p)
    return f

def invfact(n, f, p=10**9 + 7):
    inv = [pow(f[n], p-2, p)]
    for i in range(n, 0, -1):
        inv.append(inv[-1]*i%p)
    return inv[::-1]

f = fact(30+10**5)
invf = invfact(30+10**5, f)

def comb(a, b):
    return f[a] * invf[b] * invf[a-b] % p

i = 2

while m != 1 and i <= sqrt(m) + 1:
    while m % i == 0:
        m //= i
        A[i] += 1
    i += 1

if m != 1:
    A[m] = 1

n -= 1
ans = 1

for v in list(A.values()):
    ans *= comb(v+n, n)
    ans %= p

print(ans)
# Original solution
import math
n, m = list(map(int, input().split()))

mod = 10**9 + 7

b = []

c = int(math.sqrt(m))
for i in range(2, c+2):
    count = 0
    while m % i == 0:
        count += 1
        m = m // i
    b.append(count)
if m > 1:
    b.append(1)

fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, n + max(b)+3):
    fac.append(fac[i-1] * i % mod)
    inv.append(mod - inv[mod%i] * (mod//i) % mod)
    finv.append(finv[i-1] * inv[i] % mod)

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

ans = 1
for i in b:
    ans *= nck(n-1+i, i)
    ans %= mod

print(ans)

# Optimized solution
import math

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

sqrt_m = math.sqrt(m)
sqrt_m = int(sqrt_m) + 1

mod = 10**9 + 7
fac = [1, 1]
inv = [1, 1]
finv = [1, 1]
for i in range(2, n + 31):
    fac.append(fac[i-1] * i % mod)
    inv.append(mod - inv[mod%i] * (mod//i) % mod)
    finv.append(finv[i-1] * inv[i] % mod)

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


prime = []
for i in range(2, sqrt_m + 1):
    count = 0
    while m % i == 0:
        m = m // i
        count += 1
    if count > 0:
        prime.append(count)
if m > 1:
    prime.append(1)

ans = 1
for i in prime:
    ans *= nck(n-1+i, i)
    ans %= mod

print(ans)
# Original solution
import math
from collections import defaultdict

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

def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

pr = prime_factors(m)
di = {}
di = defaultdict(int)
for i in pr:
    while m % i == 0:
        m = m // i
        di[i] += 1
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

ans = 1
mod = 10 ** 9 + 7
for i in di:
    ans = ans * comb(di[i] + n - 1, di[i]) % mod
print(ans)

# Optimized solution
import math
from collections import defaultdict

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

def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

pr = prime_factors(m)
di = {}
di = defaultdict(int)
for i in pr:
    while m % i == 0:
        m = m // i
        di[i] += 1

"""def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))"""
mod = 10 ** 9 + 7
MAX_N = 10 ** 5 + 100
factorial = [1] * MAX_N
def calc_factorial():
    for i in range(1, MAX_N):
        factorial[i] = i * factorial[i - 1] % mod

def comb(n, k):
    a = factorial[n] % mod
    b = (factorial[k] * factorial[n - k]) % mod
    b_ = pow(b, mod - 2, mod)
    return (a * b_) % mod


# 階乗を用意
calc_factorial()

ans = 1

for i in di:
    ans = ans * comb(di[i] + n - 1, di[i]) % mod
print(ans)
# Original solution
# ABC110d
import sys
from collections import Counter
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


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


def combinations_with_replacement_count(n, r):
    return combinations_count(n + r - 1, r)


ans = 1
pr = Counter(prime_factorize(m))
for i in list(pr.values()):
    # print(i)
    t = combinations_count(n + i - 1, i)
    # print(t)
    ans = ans*t % MOD
# print(pr)
# print(len(pr))
print(ans)

# Optimized solution
# ABC110d
import sys
from collections import Counter
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


dp = dict()


def combinations_count(n, r):
    if dp.get(n) != None and dp.get(n).get(r) != None:
        return dp[n][r]
    if dp.get(n) == None:
        dp[n] = dict()
    dp[n].update({r: math.factorial(
        n) // (math.factorial(n - r) * math.factorial(r))})
    return dp[n][r]


def combinations_with_replacement_count(n, r):
    return combinations_count(n + r - 1, r)


ans = 1
pr = Counter(prime_factorize(m))
for i in list(pr.values()):
    # print(i)
    t = combinations_count(n + i - 1, i)
    # print(t)
    ans = ans*t % MOD
# print(pr)
# print(len(pr))
print(ans)
# Original solution
from math import floor, sqrt
from collections import Counter

MOD = 10 ** 9 + 7

# xを素因数分解する
def getPrimeFactor(x):
    ans = []
    for d in range(2, floor(sqrt(x)) + 1):
        while x % d == 0:
            ans.append(d)
            x //= d

    if x != 1:
        ans.append(x)

    return ans

# xのn乗（二分累乗法）
def power(x, n):
    ans = 1
    while n:
        if n % 2 == 1:
            ans = (ans * x) % MOD
        x = (x * x) % MOD
        n //= 2
    return ans


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

PFs = getPrimeFactor(M)
cnt = Counter(PFs)

N2 = N
if len(cnt):
    N2 += max(cnt.values())

# facts[x]: xの階乗
facts = [1] + [0] * N2
for x in range(1, N2 + 1):
    facts[x] = (facts[x - 1] * x) % MOD

# invFs[x]: xの階乗の逆元
invFs = [0] * N2 + [power(facts[N2], MOD - 2)]
for x in reversed(list(range(N2))):
    invFs[x] = (invFs[x + 1] * (x + 1)) % MOD

def comb(n, k):
    return ((facts[n] * invFs[k]) % MOD * invFs[n - k]) % MOD


ans = 1
for num in list(cnt.values()):
    ans = (ans * comb(N + num - 1, num)) % MOD
print(ans)


# Optimized solution
from math import floor, sqrt
from collections import Counter

MOD = 10 ** 9 + 7

# xを素因数分解する
def getPrimeFactor(x):
    ans = []
    for d in range(2, floor(sqrt(x)) + 1):
        while x % d == 0:
            ans.append(d)
            x //= d
    if x != 1:
        ans.append(x)
    return ans

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


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

PFs = getPrimeFactor(M)
cnt = Counter(PFs)

ans = 1
for num in list(cnt.values()):
    ans *= comb(N + num - 1, num)
print((ans % MOD))
# Original solution
from collections import defaultdict as dd
import sys
import math
n, m = list(map(int, input().split()))
dic = dd(int)

#M=1
if m == 1:
    print((1))
    sys.exit()
elif n == 1:
    print((1))
    sys.exit()

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

for i in range(2, math.ceil(m**0.5) + 3):
    while m % i == 0:
        m //= i
        dic[i] += 1
else:
    if m != 1:
        dic[m] = 1
#print(dic)

ans = 1
mod = 10**9 + 7
for count in list(dic.values()):
    ans *= combinations_count(count + n - 1, n-1) % mod

print((ans % mod))

# Optimized solution
from collections import defaultdict as dd
from sys import exit
import math
n, m = list(map(int, input().split()))
dic = dd(int)

#M=1
if m == 1:
    print((1))
    exit()

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

for i in range(2, math.ceil(m**0.5) + 3):
    while m % i == 0:
        m //= i
        dic[i] += 1
if m != 1:
    dic[m] = 1
#print(dic)

ans = 1
mod = 10**9 + 7
for count in list(dic.values()):
    ans *= combinations_count(count + n - 1, n-1) % mod

print((ans % mod))
# Original solution
mod = 10**9+7

def hurui(n):
  data = [i for i in range(2, n + 1)]
  for d in data:
    data = [x for x in data if (x == d or x % d != 0)]
  return data

MAX = 10**5 + 100

fac = [1]*(MAX+1)
for i in range(1,MAX+1):
    fac[i] = (fac[i-1]*i)%mod

rev_m = [1]*(MAX+1)
rev_m[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
    rev_m[i-1] = (rev_m[i]*i)%mod

def Comb(n,k):#nCk
    return (fac[n]*rev_m[k]*rev_m[n-k])%mod


N,M = list(map(int, input().split()))
Primes = hurui(4000)
kk = [0]*4000

while M > 1:
  for i,p in enumerate(Primes):
    if M%p == 0:
      kk[i]+=1
      M//=p
      break

ans =1
for k in kk:
  ans *= Comb(k+N-1,k)
  ans %= mod

print(ans)


# Optimized solution
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string

def factors_nojit(n):
    gaps = [1,2,2,4,2,4,2,4,6,2,6]
    length, cycle = 11, 3
    f, fs, nxt = 2, [], 0
    while f * f <= n:
        while n % f == 0:
            fs.append(f)
            n0 = n
            n //= f
        f += gaps[nxt]
        nxt += 1
        if nxt == length:
            nxt = cycle
    if n > 1: fs.append(n)
    return fs

MAX = 10**5 + 100
mod = 10**9+7

fac = [1]*(MAX+1)
for i in range(1,MAX+1):
    fac[i] = (fac[i-1]*i)%mod

rev_m = [1]*(MAX+1)
rev_m[MAX] = pow(fac[MAX],mod-2,mod)
for i in range(MAX,0,-1):
    rev_m[i-1] = (rev_m[i]*i)%mod

def Comb(n,k):#nCk
    return (fac[n]*rev_m[k]*rev_m[n-k])%mod

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

fs =  factors_nojit(M)
fs.sort()

dd = defaultdict(int)
ed = []
for f in fs:
    if dd[f] == 0:
        ed.append(f)
    dd[f] += 1

ans =1
for e in ed:
  k = dd[e]
  ans *= Comb(k+N-1,k)
  ans %= mod

print(ans)
# Original solution
N,M=list(map(int,input().split()))
import math
a=[]
ans=1
def calc(n):#nの素因数分解
    for i in range(2,int(n**0.5)+10):
        count=0
        while n%i==0:
            n//=i
            count+=1
        if count>=1:
            a.append([i,count])
    if n!=1:
        a.append([n,1])
def conb(n,k):
    return math.factorial(n)//(math.factorial(n-k)*math.factorial(k))
calc(M)
for i in range(len(a)):
    ans*=conb(a[i][1]+N-1,a[i][1])
print((ans%(10**9+7)))

# Optimized solution
N,M=list(map(int,input().split()))
a=[]
ans=1
def calc(n):#nの素因数分解
    for i in range(2,int(n**0.5)+10):
        count=0
        while n%i==0:
            n//=i
            count+=1
        if count>=1:
            a.append([i,count])
    if n!=1:
        a.append([n,1])
calc(M)
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])

    return result
for i in range(len(a)):
    ans*=cmb(a[i][1]+N-1,a[i][1])
print((ans%(10**9+7)))