You are given positive integers N and M.
How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7.
Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.

-----Constraints-----
 - All values in input are integers.
 - 1 \leq N \leq 10^5
 - 1 \leq M \leq 10^9

-----Input-----
Input is given from Standard Input in the following format:
N M

-----Output-----
Print the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.

-----Sample Input-----
2 6

-----Sample Output-----
4

Four sequences satisfy the condition: \{a_1, a_2\} = \{1, 6\}, \{2, 3\}, \{3, 2\} and \{6, 1\}.

Difficulty: interview

Starter code:

Solutions:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


class CmbMod:
    def __init__(self, n, p):
        """
        二項係数nCr(n個の区別できるものからr個のものを選ぶ組み合わせの数)をpで割った余りを求める
        """
        self.n = n
        self.p = p
        self.fact = [1, 1]
        self.factinv = [1, 1]
        self.inv = [0, 1]

    def cmb_mod(self, n, r):
        """
        二項係数nCr(mod p)をO(r)にて計算。nが大きいがrは小さい時に使用。
        """
        numer, denom = 1, 1
        for i in range(r):
            numer = (numer * (n - i)) % self.p
            denom = (denom * (i + 1)) % self.p
        return (numer * pow(denom, self.p - 2, self.p)) % self.p

    def prep(self):
        """
        二項係数nCr(mod p)をO(1)で求める為の前処理をO(N)にて実行。
        """
        for i in range(2, self.n + 1):
            self.fact.append((self.fact[-1] * i) % self.p)
            self.inv.append((-self.inv[self.p % i] * (self.p // i)) % self.p)
            self.factinv.append((self.factinv[-1] * self.inv[-1]) % self.p)

    def cmb_mod_with_prep(self, n, r):
        """
        二項係数nCr(mod p)をO(1)で求める。事前にprepを実行する事。
        """
        if (r < 0) or (n < r):
            return 0
        r = min(r, n - r)
        return self.fact[n] * self.factinv[r] * self.factinv[n - r] % self.p


def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5)) + 1):
        if n % i == 0:
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            res.append(ex)
    if n != 1:
        res.append(1)
    return res


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

    pf = prime_factorization(M)
    cmb = CmbMod(10 ** 6, mod)
    cmb.prep()

    res = 1
    for b in pf:
        res *= cmb.cmb_mod_with_prep(b + N - 1, b)
        res %= mod
    print(res)


def __starting_point():
    resolve()

__starting_point()

# coding: utf-8
import sys
import numpy as np
from collections import Counter

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 10 ** 9 + 7
# 素因数分解をして、それぞれの因数をどこに入れるか

def cmb(n, k):
    if k < 0 or k > n: return 0
    return fact[n] * fact_inv[k] % MOD * fact_inv[n-k] % MOD

def cumprod(arr, MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n-1]; arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n-1, -1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64); x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64); x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv

U = 10 ** 6  # 階乗テーブルの上限
fact, fact_inv = make_fact(U, MOD)

def prime_factorize(n): # 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

N, M = lr()
primes = prime_factorize(M)
counter = Counter(primes)
answer = 1
for v in list(counter.values()):
    cases = cmb(N-1+v, v)
    answer *= cases
    answer %= MOD

print((answer % MOD))
# np.int64とint型の違いに注意
# 16


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 == []:
        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 + 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 - 選んだ数））

if N == 1 or M == 1:
    print((1))
    return
ans = 1
for p, cnt in primes:
    tmp = 0
    for i in range(1, min(cnt, N)+1):
        tmp += cmb(N, i, mod) * cmb(cnt-1, i-1, mod)
        #print(tmp, p, cnt, i)
        tmp %= mod
    ans *= tmp
    ans %= mod

print(ans)


from collections import defaultdict
N,M=map(int,input().split())
count=defaultdict(int)
p=2
while p<=10**4.5+5:
    if M%p==0:
        count[p] += 1
        M//=p
    else:
        p+=1
if M>1:
    count[M]+=1
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
ans=1
mod=10**9+7
for i in count.keys():
  ans*=cmb(N-1+count[i],count[i])
  ans%=mod
print(ans)

MAX = 10**6
MOD = 10**9+7

fac = [0] * (MAX+1)
finv = [0] * (MAX+1)
inv = [0] * (MAX+1)

def comb_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MAX+1):
        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 comb(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


def prime_factorize(n):
    table = {}
    while n % 2 == 0:
        table[2] = table.get(2, 0) + 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            table[f] = table.get(f, 0) + 1
            n //= f
        else:
            f += 2
    if n != 1:
        table[n] = table.get(n, 0) + 1
    return table


def __starting_point():
    n, m = list(map(int, input().split()))
    comb_init()
    prime_factor = prime_factorize(m)
    res = 1
    for v in list(prime_factor.values()):
        res *= comb(v+n-1, n-1)
        res %= MOD
    print(res)

__starting_point()

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==[]:
        arr.append([n, 1])
 
    return arr
 
def cmb(n,r,mod):
  a=1
  b=1
  r = min(r,n-r)
  for i in range(r):
    a = a*(n-i)%mod
    b = b*(i+1)%mod
  return a*pow(b,mod-2,mod)%mod

N,M = map(int,input().split())
MOD = 10**9+7
f = factorization(M)
ans = 1

for i,j in f:
  ans *= cmb(j+N-1,j,MOD)
  ans %= MOD
if M == 1:
  ans = 1
print(ans)

N,M = 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)

# coding: utf-8
from collections import Counter


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


def solve(*args: str) -> str:
    n, m = list(map(int, args[0].split()))
    mod = 10**9+7
    C = Counter()

    i = 2
    r = -int(-m**(1/2)//1)
    while 1 < m:
        while m % i == 0:
            C[i] += 1
            m //= i
        if r < i:
            C[m] = 1
            break
        i += 1

    ret = 1
    for v, c in list(C.items()):
        ret *= ncr(n+c-1, min(n-1, c), mod)
        ret %= mod

    return str(ret)


def __starting_point():
    print((solve(*(open(0).read().splitlines()))))

__starting_point()

from collections import Counter

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

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

    MOD = pow(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 make_fact_list(n, MOD):
        # make factorial list from 0 to n
        fact = [0] * (n+1)
        inv = [0] * (n+1)
        factinv = [0] * (n+1)

        fact[0]=fact[1]=1
        inv[1]=1
        factinv[0]=factinv[1]=1

        for i in range(2,n+1):
            fact[i] = fact[i-1] * i % MOD
            inv[i] = MOD - (( inv[MOD % i] *  (MOD // i)) % MOD )
            factinv[i] = factinv[i-1] * inv[i] % MOD
        
        return fact, factinv

    def cbn(n, k, MOD, fact = [], factinv = []):
        if len(fact) == 0 and len(factinv) == 0:
            fact, factinv = make_fact_list(n, MOD)
        return fact[n] * factinv[n-k] * factinv[k] % MOD


    d = Counter(prime_factorize(m)).most_common()

    l = d[0][1] + n 

    fact, factinv = make_fact_list(l, MOD)

    a = 1

    for k, v in d:
        a *= cbn(v + n - 1, v, MOD, fact = fact, factinv = factinv) % MOD

    print(a % MOD)

#!/usr/bin/env python3
import sys

MOD = 1000000007  # type: int


def solve(N: int, M: int):
    factors = {}
    m = M
    for i in range(2, int(M**0.5)+1):
        while m % i == 0:
            factors[i] = factors.get(i, 0) + 1
            m //= i
    else:
        if m != 1:
            factors[m] = 1
    mf = ModFactorial(MOD)
    ans = 1
    for c in list(factors.values()):
        ans = ans * mf.combination(c+N-1, c) % MOD
    return ans
        

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    print((solve(N, M)))

def test():
    import doctest
    doctest.testmod()


def mod_range(mod, start, stop=None, step=1):    
    if stop == None:
        stop = start
        start = 0
    return [i % mod for i in range(start, stop, step)]

def mod_inv(mod, n):
    '''
    >>> mod_inv(3, 2)
    2
    >>> mod_inv(1000000007, 2)
    500000004
    '''
    return pow(n, mod-2, mod)

def mod_permutation(mod, n, r):
    '''
    >>> mod_permutation(1000000007, 10, 2)
    90
    >>> mod_permutation(7, 10, 2)
    6
    '''
    m = 1
    for i in mod_range(mod, n-r+1, n+1):
        m = (m * i) % mod
    return m

def mod_factorial(mod, n):
    '''
    >>> mod_factorial(1000000007, 10)
    3628800
    >>> mod_factorial(7, 6)
    6
    '''
    return mod_permutation(mod, n, n)

def mod_combination(mod, n, r):
    '''
    >>> mod_combination(1000000007, 10, 2)
    45
    >>> mod_combination(7, 10, 2)
    3
    '''
    return mod_permutation(mod, n, r) * mod_inv(mod, mod_factorial(mod, r)) % mod

class ModFactorial:
    def __init__(self, mod, size=1):
        '''
        >>> ModFactorial(7, 7)
        Traceback (most recent call last):
        ...
        AssertionError
        '''
        assert mod > size
        self._mod = mod
        self._init_factorials(size)

    def _mod_range(self, start, stop=None, step=1):
        return mod_range(self._mod, start, stop, step)
    
    def _mod_inv(self, n):
        return mod_inv(self._mod, n)
    
    def _init_factorials(self, size):
        '''
        >>> mf1 = ModFactorial(1000000007)
        >>> mf2 = ModFactorial(1000000007, 10)
        >>> mf1.factorial(10) == mf2.factorial(10)
        True
        '''
        self._factorials = [1] * size        
        n = 1 # リストの参照は遅いので減らす
        for i, m in enumerate(self._mod_range(1, size), 1):
            n = (n * m) % self._mod
            self._factorials[i] = n
            
    def _append_factorials(self, n):
        for m in [i % self._mod for i in range(len(self._factorials), n+1)]:
            self._factorials.append((self._factorials[-1] * m) % self._mod)

    def factorial(self, n):
        '''
        >>> ModFactorial(1000000007).factorial(10)
        3628800
        >>> ModFactorial(7).factorial(6)
        6
        >>> ModFactorial(7).factorial(7)
        Traceback (most recent call last):
        ...
        AssertionError
        '''
        assert n < self._mod
        if len(self._factorials) <= n:
            self._append_factorials(n)
        return self._factorials[n]

    def factorial_inv(self, n):
        '''
        >>> MOD = 1000000007
        >>> mf = ModFactorial(MOD)
        >>> mf.factorial_inv(10)
        283194722
        >>> mf.factorial_inv(10) * mf.factorial(10) % MOD
        1
        >>> MOD = 7
        >>> mf = ModFactorial(MOD)
        >>> mf.factorial_inv(6)
        6
        >>> mf.factorial_inv(6) * mf.factorial(6) % MOD
        1
        '''
        return self._mod_inv(self.factorial(n))

    def permutation(self, n, r):
        '''
        >>> ModFactorial(1000000007).permutation(10, 2)
        90
        '''
        return self.factorial(n) * self.factorial_inv(n-r) % self._mod

    def combination(self, n, r):
        '''
        >>> ModFactorial(1000000007).combination(10, 2)
        45
        '''
        return self.permutation(n, r) * self.factorial_inv(r) % self._mod


def __starting_point():
    #test()
    main()

__starting_point()

def prime_factorization(n):
    """
    nを素因数分解
    :param n:
    :return:素因数分解結果 [(素数S1, count S1),(素数S2, count S2), ...]

    """
    from math import sqrt
    if (n == 0): return []
    if (n == 1): return [(1, 1)]

    res = []
    for i in range(2, int(sqrt(n)) + 1):
        if n == 1: break
        cnt = 0
        while n % i == 0:
            cnt += 1
            n = n // i
        if cnt > 0:
            res.append((i, cnt))
    if n > 1:
        res.append((n, 1))

    return res


class ModFactorial:
    """
    階乗, 組み合わせ, 順列の計算
    """

    def __init__(self, n, MOD=10 ** 9 + 7):
        """

        :param n: 最大の要素数.
        :param MOD:
        """
        kaijo = [0] * (n + 10)
        gyaku = [0] * (n + 10)

        kaijo[0] = 1
        kaijo[1] = 1
        for i in range(2, len(kaijo)):
            kaijo[i] = (i * kaijo[i - 1]) % MOD
        gyaku[0] = 1
        gyaku[1] = 1
        for i in range(2, len(gyaku)):
            gyaku[i] = pow(kaijo[i], MOD - 2, MOD)
        self.kaijo = kaijo
        self.gyaku = gyaku
        self.MOD = MOD

    def nCm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m] * self.gyaku[m]) % self.MOD

    def nPm(self, n, m):
        return (self.kaijo[n] * self.gyaku[n - m]) % self.MOD

    def factorial(self, n):
        return self.kaijo[n]


N, M = [int(_) for _ in input().split()]
if M == 1:
    print((1))
    return

primes = [v for _, v in prime_factorization(M)]

MOD = 10 ** 9 + 7
mf = ModFactorial(max(primes) + 1 + N, MOD)

ans = 1
for cnt in primes:
    ans = ans * mf.nCm(cnt + N - 1, N - 1)
    ans = ans % MOD
print(ans)


def modpow(a,n):
  if n<1:
    return 1
  ans=modpow(a,n//2)
  ans=(ans*ans)%mod
  if n%2==1:
    ans*=a
  return ans%mod

def conb(n,i):
  inv,ans=1,1
  for j in range(1,i+1):
    ans=ans*(n-j+1)%mod
    inv=inv*j%mod
  return (ans*modpow(inv,mod-2))%mod


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(cnt)
    if temp!=1:
        arr.append(1)

    if arr==[]:
        arr.append(1)
    return arr



mod=10**9+7
N,M=[int(x) for x in input().rstrip().split()]
fact=factorization(M)
ans=1

if M==1:
  print((1))
else:
  for i in fact:
    ans*=conb(i+N-1,N-1)
  print((ans%mod))



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


def factorization(n):
    retval = []
    tmp = n
    for i in range(2, int(-(-n**.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            retval.append((i, cnt))
    if tmp != 1:
        retval.append((tmp, 1))
    if not retval:
        retval.append((n, 1))
    return retval


fact = factorization(m)


def com(n, r):
    X = Y = 1
    if n-r < r:
        r = n-r
    for i in range(1, r+1):
        Y = Y*i % MOD
        X = X*(n-i+1) % MOD
    Y = pow(Y, MOD-2, MOD)
    return X*Y


ans = 1
for f in fact:
    ans *= com(n+f[1]-1, n-1)
if m == 1:
    print(1)
else:
    print(ans % MOD)

class Calc:
    def __init__(self, max_value, mod):
        """combination(max_value, all)"""
        fact = [-1] * (max_value + 1)
        fact[0] = 1
        fact[1] = 1
        for x in range(2, max_value + 1):
            fact[x] = x * fact[x - 1] % mod

        invs = [1] * (max_value + 1)
        invs[max_value] = pow(fact[max_value], mod - 2, mod)
        for x in range(max_value - 1, 0, -1):
            invs[x] = invs[x + 1] * (x + 1) % mod

        self.fact = fact
        self.invs = invs
        self.mod = mod

    def combination(self, n, r):
        if n - r < r:
            return self.combination(n, n - r)
        if r < 0:
            return 0
        if r == 0:
            return 1
        if r == 1:
            return n
        return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod


def gen(n):
    x = n
    d = 2
    cnt = 0
    while x % d == 0:
        x //= d
        cnt += 1
    yield cnt

    d = 3
    ma = d * d
    while ma <= n:
        cnt = 0
        while x % d == 0:
            x //= d
            cnt += 1
        yield cnt
        ma += d * 4 + 4
        d += 2

    if x > 1:
        yield 1


def main():
    MOD = 10 ** 9 + 7

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

    cal = Calc(max_value=N + 30, mod=MOD)

    ans = 1
    for cnt in gen(M):
        ans = (ans * cal.combination(N + cnt - 1, cnt)) % MOD
    print(ans)


def __starting_point():
    main()

__starting_point()

# D - Factorization

N, M = map(int, input().split())
MOD = 10**9 + 7

def prime_factorization(n):
    prime_factors = []
    if n < 2:
        return 0
    for i in range(2, int(pow(n, 0.5)+1)):
        if n%i==0:
            ex = 0
            while n%i==0:
                ex += 1
                n //= i
            prime_factors.append((i, ex))
    if n!=1:
        prime_factors.append((n,1))
    return prime_factors

fac = [1, 1]
inv = [0, 1]
finv = [1, 1]

for i in range(2, N+36):
    fac.append(fac[-1] * i % MOD)
    inv.append(MOD - inv[MOD%i] * (MOD//i) % MOD)
    finv.append(finv[-1] * inv[-1] % MOD)

def comb_mod(n, r, m):
    if (n<0 or r<0 or n<r): return 0
    r = min(r, n-r)
    return fac[n] * finv[n-r] * finv[r] % m

primes = prime_factorization(M)
ans = 1
if primes != 0:
    for (p, ex) in primes:
        ans = (ans * comb_mod(ex+N-1, N-1, MOD)) % MOD

print(ans)

from collections import defaultdict
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[i] = cnt

    if temp != 1:
        arr[temp] = 1
    if len(list(arr.keys())) == 0:
        arr[n] = 1
    return arr


def prepare(n, MOD):

    # 1! - n! の計算
    f = 1
    factorials = [1]  # 0!の分
    for m in range(1, n + 1):
        f *= m
        f %= MOD
        factorials.append(f)
    # n!^-1 の計算
    inv = pow(f, MOD - 2, MOD)
    # n!^-1 - 1!^-1 の計算
    invs = [1] * (n + 1)
    invs[n] = inv
    for m in range(n, 1, -1):
        inv *= m
        inv %= MOD
        invs[m - 1] = inv

    return factorials, invs

import math
from itertools import combinations
from collections import Counter
MOD = 1000000007

def solve():
    N, M = list(map(int, input().split()))
    temp = factorization(M)
    #print(temp)
    max_num = max(temp.values())
    factorials, invs = prepare(N+max_num-1, MOD)
    #print(factorials, invs)
    ans = 1
    for i, j in list(temp.items()):
        if i == 1:
            break
        ans *= factorials[N+j-1]
        ans %= MOD
        ans *= invs[N-1]
        ans %= MOD
        ans *= invs[j]
        ans %= MOD
        #print(ans)
    print(ans)


def __starting_point():
    solve()

__starting_point()

import sys
import collections

input = sys.stdin.readline


def modInverse(a, p):
    return pow(a, p - 2, p)


def modBinomial(n, k, p):
    numerator = 1
    for i in range(k):
        numerator = (numerator * (n - i)) % p

    denominator = 1
    for i in range(1, k + 1):
        denominator = (denominator * i) % p

    return (numerator * modInverse(denominator, p)) % p


def main():
    N, M = [int(x) for x in input().split()]

    MOD = 10 ** 9 + 7

    def prime_factorization(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

    x = prime_factorization(M)

    c = collections.Counter(x)

    ans = 1
    for k in list(c.keys()):
        ans *= modBinomial(c[k] + N - 1, c[k], MOD)

    print((ans % MOD))


def __starting_point():
    main()

__starting_point()

def gen(n):
    x = n
    d = 2
    cnt = 0
    while x % d == 0:
        x //= d
        cnt += 1
    yield cnt

    d = 3
    while d * d <= n:
        cnt = 0
        while x % d == 0:
            x //= d
            cnt += 1
        yield cnt
        d += 2

    if x > 1:
        yield 1


def main():
    MOD = 10 ** 9 + 7

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

    ans = 1
    for cnt in gen(M):
        for d in range(cnt):
            ans = (ans * (N - 1 + cnt - d) % MOD) * pow(d + 1, MOD - 2, MOD) % MOD
            
    print(ans)


def __starting_point():
    main()

__starting_point()

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

Msq = int(M**(1/2)) + 2
yaku = []

for i in range(2, Msq):
  now = 0
  while M%i == 0:
    M = M//i
    now += 1
  if now >= 1:
    yaku.append(now)
    
if M > 1:
  yaku.append(1)
  
yaku.sort()

MOD = 1000000007
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)
for i in range(1, num):
  finv[num-1-i] = finv[num-i] * (num-i) % MOD
  
ans = 1
for i in yaku:
  ans = ans * frac[N+i-1] * finv[N-1] * finv[i] % MOD
  
print(ans)


import collections,sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,M = LI()
ans = 1
def prime_factor(num):
    prime_factor = collections.defaultdict(int)
    for i in range(2,int(num**0.5)+1):
        while num%i==0:
            prime_factor[i] += 1
            num //= i
    if num>1:
        prime_factor[num]=1
    return prime_factor
def nCr(n,r,mod):
    comb_count = 1
    for i in range(r):
        comb_count *= n-i
        comb_count %= mod
    for j in range(1,r+1):
        comb_count *= pow(j,mod-2,mod)
        comb_count %= mod
    return comb_count
for v in list(prime_factor(M).values()):
    ans *= nCr(v+N-1,v,10**9+7)
    ans %= 10**9+7
print(ans)


import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SI(): return input().split()

def printlist(lst, k='\n'): print((k.join(list(map(str, lst)))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush


def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5))+1):
        if n % i: continue
        ex = 0
        while n % i == 0:
            n = n // i
            ex += 1
        res.append((i, ex))
    if n != 1:
        res.append((n, 1))
    return res

def mcomb(n, k, mod):
    def mfac(l, r, mod):
        ans = l
        for i in reversed(list(range(r, l))):
            ans *= i
            ans %= mod
        return ans

    A = mfac(n,n-k+1,mod)
    B = mfac(k,1,mod)
    # B = mpow(B,mod-2,mod)
    B = pow(B, mod-2, mod)
    return A * B % mod

def solve():
    n, m = MI()
    fact = prime_factorization(m)
    if n == 1:
        print((1))
        return
    # print(fact)
    mod = 1000000007
    ans = 1
    for num, ex in fact:
        # print(ex, mcomb(ex+n-2, n-1, mod))
        ans *= mcomb(ex+n-1, n-1, mod) % mod
    print((ans % mod))


def __starting_point():
    solve()

__starting_point()

#!/usr/bin/env python3

import sys
import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return list(map(int, input().split()))
    def mi_0():  return [int(x)-1 for x in input().split()]
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list([int(x)-1 for x in input().split()])
    def li():    return list(input())
    
        
    class Eratos:
        def __init__(self, num):
            assert(num >= 1)
            self.table_max = num
            # self.table[i] は i が素数かどうかを示す (bool)
            self.table = [False if i == 0 or i == 1 else True for i in range(num+1)]
            for i in range(2, int(math.sqrt(num)) + 1):
                if self.table[i]:
                    for j in range(i ** 2, num + 1, i):    # i**2 からスタートすることで定数倍高速化できる
                        self.table[j] = False
            # self.table_max 以下の素数を列挙したリスト
            self.prime_numbers = [2] if self.table_max >= 2 else []
            for i in range(3, self.table_max + 1, 2):
                if self.table[i]:
                    self.prime_numbers.append(i)
        
        def is_prime(self, num):
            """
            >>> e = Eratos(100)
            >>> [i for i in range(1, 101) if e.is_prime(i)]
            [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
            """
            assert(num >= 1)
            if num > self.table_max:
                raise ValueError('Eratos.is_prime(): exceed table_max({}). got {}'.format(self.table_max, num))
            return self.table[num]
        
        def prime_factorize(self, num):
            """
            >>> e = Eratos(10000)
            >>> e.prime_factorize(6552)
            {2: 3, 3: 2, 7: 1, 13: 1}
            """
            assert(num >= 1)
            if int(math.sqrt(num)) > self.table_max:
                raise ValueError('Eratos.prime_factorize(): exceed prime table size. got {}'.format(num))
            factorized_dict = dict()    # 素因数分解の結果を記録する辞書
            candidate_prime_numbers = [i for i in range(2, int(math.sqrt(num)) + 1) if self.is_prime(i)]
            # n について、√n 以下の素数で割り続けると最後には 1 or 素数となる
            # 背理法を考えれば自明 (残された数が √n より上の素数の積であると仮定。これは自明に n を超えるため矛盾)
            for p in candidate_prime_numbers:
                # これ以上調査は無意味
                if num == 1:
                    break
                while num % p == 0:
                    num //= p
                    try:
                        factorized_dict[p]
                    except KeyError:
                        factorized_dict[p] = 0
                    finally:
                        factorized_dict[p] += 1
            if num != 1:
                factorized_dict[num] = 1
            return factorized_dict
    

    n, m = mi()
    eratos = Eratos(max(int(math.sqrt(m)), n))
    d = eratos.prime_factorize(m)
    # print(d)

    FACT = [1] * (n + int(math.log2(m)) + 1)
    for i in range(2, n + int(math.log2(m)) + 1):
        FACT[i] = (FACT[i-1] * i) % mod
    
    def comb(n, r, m):
        numerator = FACT[n]
        denominator = pow(FACT[n-r] * FACT[r], m - 2, m)
        return (numerator * denominator) % m

    ans = 1
    for _, k in list(d.items()):
        ans = (ans * comb(k + n - 1, k, mod)) % mod
    print(ans)


def __starting_point():
    main()

__starting_point()

from collections import Counter
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

MOD=10**9+7
n,m=map(int,input().split())
c = Counter(prime_factorize(m))
cv=list(c.values())
ans=1
for i in cv:
    for j in range(i):
        ans*=i+n-1-j
        ans%=MOD
        ans*=pow(1+j,MOD-2,MOD)
        ans%=MOD
print(ans)

#!/usr/bin/env python3
def modinv(a, mod):
    return pow(a, mod - 2, mod)

MOD = 10**9+7
class Factorial:
    def __init__(self, n, mod):
        # O(n + log mod)
        self.f = f =[0] * (n + 1)
        f[0] = b = 1
        for i in range(1, n + 1):
            f[i] = b = b * i % mod
        self.inv = inv = [0] * (n + 1)
        inv[n] = b = modinv(self.f[n], mod) # pow(self.f[n], -1, mod) が Google Colab, Python ver. が低く Error
        for i in range(n, 0, -1):
            inv[i - 1] = b = b * i % mod
        self.mod = mod
    
    def __call__(self, n, k):  # self.C() と同じ
        return self.C(n, k)

    def factorial(self, i):
        return self.f[i]

    def ifactorial(self, i):
        return self.inv[i]

    def C(self, n, k):
        if not 0 <= k <= n: return 0
        return self.f[n] * self.inv[n - k] * self.inv[k] % self.mod

    def P(self, n, k):
        if not 0 <= k <= n: return 0
        return self.f[n] * self.inv[n - k] % self.mod

    def H(self, n, k):
        if (n == 0 and k > 0) or k < 0: return 0
        return self.f[n + k - 1] * self.inv[k] % self.mod * self.inv[n - 1] % self.mod

def factorize(n) -> list:
    b, e = 2, 0
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            e += 1
        if e:
            fct += (b, e), # b,
        b += 1
        e = 0
    if n > 1:
        fct += (n, 1), # n,
    return fct

n, m = map(int, input().split())
F = Factorial(n + 30, MOD)
c = 1
for _, E in factorize(m):
    c = c * F.H(n, E) % MOD
print(c)

# coding: utf-8
import sys
import numpy as np
from collections import Counter

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 10 ** 9 + 7
# 素因数分解をして、それぞれの因数をどこに入れるか

def cmb(n, k):
    if k < 0 or k > n: return 0
    return fact[n] * fact_inv[k] % MOD * fact_inv[n-k] % MOD

def cumprod(arr, MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr, Lsq**2).reshape(Lsq, Lsq)
    for n in range(1, Lsq):
        arr[:, n] *= arr[:, n-1]; arr[:, n] %= MOD
    for n in range(1, Lsq):
        arr[n] *= arr[n-1, -1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U, MOD):
    x = np.arange(U, dtype=np.int64); x[0] = 1
    fact = cumprod(x, MOD)
    x = np.arange(U, 0, -1, dtype=np.int64); x[0] = pow(int(fact[-1]), MOD-2, MOD)
    fact_inv = cumprod(x, MOD)[::-1]
    return fact, fact_inv

U = 10 ** 5 + 100  # 階乗テーブルの上限
fact, fact_inv = make_fact(U, MOD)

def prime_factorize(n): # 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

N, M = lr()
primes = prime_factorize(M)
counter = Counter(primes)
answer = 1
for v in list(counter.values()):
    cases = cmb(N-1+v, v)
    answer *= cases
    answer %= MOD

print((answer % MOD))
# np.int64とint型の違いに注意
# 16


from collections import Counter  # N : 素因数分解

MOD = 10**9 + 7


def comb(n, r):
    r = r if n-r <= r else n-r
    a = 1
    for x in list(range(r + 1, n + 1)):
        a *= x % MOD
    b = 1
    for x in list(range(1, n - r + 1)):
        b *= x % MOD
    return (a // b)


N, M = [int(s) for s in input().split()]
prime_factor = []
for i in range(2,int(M**0.5)+1):
    while M%i == 0:
        prime_factor.append(i)
        M/=i
if M > 1:
    prime_factor.append(M)
    
c = Counter(prime_factor)

result = 1

for b in list(c.values()):
    result *= comb(b+N-1, b) % MOD


print((result % MOD))


N, M = map(int, input().split())
mod = pow(10, 9) + 7

def comb(n, k):
  if k > n-k:
    return comb(n, n-k)
  mul, div = 1, 1
  for i in range(k):
    mul = mul * (n-i) % mod
    div = div * (k-i) % mod
  ret = mul * pow(div, mod-2, mod) % mod
  return ret

i = 2
ans = 1
tmp = M
while i * i <= M:
  if tmp % i == 0:
    cnt = 0
    while tmp % i == 0:
      tmp //= i
      cnt += 1
    ans = ans * comb(cnt+N-1, N-1) % mod
  i += 1
if tmp != 1:
  ans = ans * comb(1+N-1, N-1) % mod
print(ans)

MOD=10**9+7
UPPERLIMIT=2*10**5
MODMUL=[1, 1]+[0]*(UPPERLIMIT-1)
for i in range(2, UPPERLIMIT+1):
  MODMUL[i]=MODMUL[i-1]*i%MOD
MODDIV=[1]*UPPERLIMIT+[pow(MODMUL[-1], MOD-2, MOD)]
for i in range(UPPERLIMIT, 0, -1):
  MODDIV[i-1]=MODDIV[i]*i%MOD
def MODCOMB(n, r):
  return (((MODMUL[n]*MODDIV[r])%MOD)*MODDIV[n-r])%MOD

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

from collections import defaultdict
def PrimeFactorization(x):
  out=defaultdict(int)
  for i in range(2, int(pow(x, 1/2))+1):
    while x%i==0:
      out[i]+=1
      x//=i
  if x>1:
    out[x]+=1
  return out

primenums=PrimeFactorization(M)
ans=1
for x in primenums.values():
  ans*=MODCOMB(N+x-1, N-1)
  ans%=MOD
  
print(ans)

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

mod = 10 ** 9 + 7
N = 200000

#逆元テーブル
inv_t = [0]+[1]
for i in range(2, N):
  inv_t += [inv_t[mod % i] * (mod - int(mod / i)) % mod]

#階乗計算
kai = [1, 1]
rev_kai = [1, inv_t[1]]
for i in range(2, N):
	kai.append(kai[-1] * i % mod)
	rev_kai.append(rev_kai[-1] * inv_t[i] % mod)

# コンビネーション計算
def cmb(n, r):
	return kai[n] * rev_kai[r] * rev_kai[n-r] % mod

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==[]:
        arr.append([n, 1])

    return arr

ans = 1

for _, cnt in factorization(m):
    if _ == 1:
        break
    ans = ans * cmb(cnt + n - 1, n - 1) % mod

print(ans)

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return list(map(int, input().split()))
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return list(zip(*(MAP() for _ in range(n))))
sys.setrecursionlimit(10 ** 9)
INF = 10**6#float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

		
#階乗#
lim = 2*10**5   #必要そうな階乗の限界を入力
fact = [1] * (lim+1)
for n in range(1, lim+1):
	fact[n] = n * fact[n-1] % mod

#階乗の逆元#
fact_inv = [1]*(lim+1)
fact_inv[lim] = pow(fact[lim], mod-2, mod)
for n in range(lim, 0, -1):
	fact_inv[n-1] = n*fact_inv[n]%mod

def C(n, r):
	return (fact[n]*fact_inv[r]%mod)*fact_inv[n-r]%mod


#素因数分解
def factorization(n):
	arr = []
	tmp = n
	for i in range(2, int(-(-n**0.5//1))+1):
		if tmp%i == 0:
			cnt = 0
			while tmp%i == 0:
				cnt += 1
				tmp //= i
			arr.append([i, cnt])
	if tmp != 1:
		arr.append([tmp, 1])
	if arr == []:
		arr.append([n, 1])
	return arr


N, M = MAP()
if M == 1:
	print((1))
	return

arr = factorization(M)
ans = 1
for g, n in arr:
	ans *= C(N-1+n, n)
	ans %= mod

print(ans)


N,M=map(int,input().split())
mod=10**9+7
 
def nCmMOD(A,B,Mod):
    num,den=1,1
    for i in range(B):
        num*=(A-i)
        den*=(i+1)
        num%=Mod
        den%=Mod
    return (num*pow(den,Mod-2,Mod))%Mod
 
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==[]:
        arr.append([n, 1])
    return arr
 
ans=1
F=factorization(M)
for i in range(len(F)):
    f=F[i][1]
    ans*=nCmMOD(f+N-1,N-1,mod)
    ans%=mod
 
if M==1:
    print(1)
else:
    print(ans)

def factorize(n):
    '''
    素因数分解をする。
    タプルの配列にしようと思ったけど、逐次割り算する過程で次数を増やせないじゃん。
    二重配列?
    dictにしよう。
    '''
    if n == 1:
        raise('n >= 2')
    
    factor = {}
    div = 2
    while True:
        if div * div > n:
            factor[n] = factor.get(n, 0) + 1
            return factor

        if n % div == 0:
            n //= div
            factor[div] = factor.get(div, 0) + 1
        else:
            div += 1




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

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

factor = factorize(m)


max_len = n + 100  # 適宜変更する
mod = 10**9 + 7


def modinv(x):
    '''
    xの逆元を求める。フェルマーの小定理より、 x の逆元は x ^ (mod - 2) に等しい。計算時間はO(log(mod))程度。
    Python標準のpowは割った余りを出すことも可能。
    '''
    return pow(x, mod-2, mod)


# 二項係数の左側の数字の最大値を max_len　とする。nとかだと他の変数と被りそうなので。
# factori_table = [1, 1, 2, 6, 24, 120, ...] 要は factori_table[n] = n!
# 計算時間はO(max_len * log(mod))
modinv_table = [-1] * (max_len + 1)
modinv_table[0] = None  # 万が一使っていたときにできるだけ早期に原因特定できるようにしたいので、Noneにしておく。
factori_table = [1] * (max_len + 1)
factori_inv_table = [1] * (max_len + 1)
for i in range(1, max_len + 1):
    factori_table[i] = factori_table[i-1] * (i) % mod

modinv_table[1] = 1
for i in range(2, max_len + 1):
    modinv_table[i] = (-modinv_table[mod % i] * (mod // i)) % mod
    factori_inv_table[i] = factori_inv_table[i-1] * modinv_table[i] % mod


def binomial_coefficients(n, k):
    '''
    n! / (k! * (n-k)! )
    0 <= k <= nを満たさないときは変な値を返してしまうので、先にNoneを返すことにする。
    場合によっては0のほうが適切かもしれない。
    '''
    if not 0 <= k <= n:
        return None
    return (factori_table[n] * factori_inv_table[k] * factori_inv_table[n-k]) % mod


ans = 1
mod = 10**9 + 7
for prime, power in list(factor.items()):
    # ans *= n H power = n+power-1 C power 
    ans *= binomial_coefficients(n+power-1, power)
    ans %= mod

print(ans)


#素因数分解
def soinsu_bunkai(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

# 組み合わせの総数 p=10**9+7 で割ったあまりを求める Satoooh Blog 2020/02/27 4分 
"""n<10**7 , p は素数"""
def cmb(n, r, p):

    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p



# 初期入力
from collections import Counter
import sys
input = sys.stdin.readline  #文字列では使わない
mod =10**9 +7
p =mod
N,M = map(int, input().split())
a =soinsu_bunkai(M)
ans =1

n = 10 ** 6  # n は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

#mod p における n の逆元の計算
for i in range(2, n + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

for i in a.values():
    x =cmb(N +i -1,i,mod)
    ans *=x
print(ans %mod)

MOD = 10**9 + 7

class Combination:
    def __init__(self, size):
        self.size = size + 2
        self.fact = [1, 1] + [0] * size
        self.factInv = [1, 1] + [0] * size
        self.inv = [0, 1] + [0] * size

        for i in range(2, self.size):
            self.fact[i] = self.fact[i - 1] * i % MOD
            self.inv[i] = -self.inv[MOD % i] * (MOD // i) % MOD
            self.factInv[i] = self.factInv[i - 1] * self.inv[i] % MOD

    def npr(self, n, r):
        if n < r or n < 0 or r < 0:
            return 0
        return self.fact[n] * self.factInv[n - r] % MOD

    def ncr(self, n, r):
        if n < r or n < 0 or r < 0:
            return 0
        return self.fact[n] * (self.factInv[r] * self.factInv[n - r] % MOD) % MOD

    def nhr(self, n, r):  # 重複組合せ: x_1 + ... + x_n = r
        return self.ncr(n + r - 1, n - 1)

N, M = list(map(int, input().split()))
comb = Combination(N + 100)

def primeCount(N):
    R = int(N**(0.5)) + 1  # 素数の範囲
    primes = {}  # 素数のリスト
    n = N
    for num in range(2, R):
        primes[num] = 0
        while n % num == 0:
            n //= num
            primes[num] += 1
    if n > 1 :
        primes[n] = 1
    return { key : val for key, val in list(primes.items()) if val > 0}  # フィルターをかける

ans = 1
for c in list(primeCount(M).values()):
    ans *= comb.nhr(N, c)
    ans %= MOD
print(ans)


class Calc:
    def __init__(self, max_value, mod):
        """combination(max_value, all)"""
        fact = [-1] * (max_value + 1)
        fact[0] = 1
        fact[1] = 1
        for x in range(2, max_value + 1):
            fact[x] = x * fact[x - 1] % mod

        invs = [1] * (max_value + 1)
        invs[max_value] = pow(fact[max_value], mod - 2, mod)
        for x in range(max_value - 1, 0, -1):
            invs[x] = invs[x + 1] * (x + 1) % mod

        self.fact = fact
        self.invs = invs
        self.mod = mod

    def combination(self, n, r):
        if n - r < r:
            return self.combination(n, n - r)
        if r < 0:
            return 0
        if r == 0:
            return 1
        if r == 1:
            return n
        return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod


def gen(n):
    x = n
    d = 2
    cnt = 0
    while x % d == 0:
        x //= d
        cnt += 1
    yield cnt

    d = 3
    while d * d <= n:
        cnt = 0
        while x % d == 0:
            x //= d
            cnt += 1
        yield cnt
        d += 2

    if x > 1:
        yield 1


def main():
    MOD = 10 ** 9 + 7

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

    cal = Calc(max_value=N + 30, mod=MOD)

    ans = 1
    for cnt in gen(M):
        ans = (ans * cal.combination(N + cnt - 1, cnt)) % MOD
    print(ans)


def __starting_point():
    main()

__starting_point()

from collections import Counter

N,M=map(int,input().split())
mod = 10**9+7

factorial=[1 for i in range(10**6)]
for i in range(2,10**6):
    factorial[i] = factorial[i-1]*i % mod

def comb(n,k):
    return (factorial[n]*pow(factorial[n-k]*factorial[k], -1, mod))%mod

def factorize(n):
    out=[]
    i = 2
    while 1:
        if n%i==0:
            out.append(i)
            n //= i
        else:
            i += 1
        if n == 1:break
        if i > int(n**.5+3):
            out.append(n)
            break
    
    return out
  
c = Counter(factorize(M))

ans = 1
for k in c.keys():
  ans *= comb(c[k]+N-1,N-1)
  ans %= mod
  
print(ans)

mod1,mod2=10**9+7,998244353
mod=mod1
n,m=map(int,input().split())
mod=10**9+7
fact=[1]*(n+50+1)
inv=[1]*(n+50+1)
for i in range(2,n+50+1):
    fact[i]=i*fact[i-1]%mod
inv[-1]=pow(fact[-1],mod-2,mod)
for i in range(n+50,1,-1):
    inv[i-1]=inv[i]*i%mod
def comb(x,y):return fact[x]*inv[y]%mod*inv[x-y]%mod if x>=y>=0 else 0
from math import floor,sqrt
ans=1
for i in  range(2,floor(sqrt(m))+1):
    if m%i:continue
    cnt=0
    while m%i==0:
        cnt+=1
        m//=i
    ans=ans*comb(n-1+cnt,cnt)%mod
if m!=1:
    ans=ans*comb(n,1)%mod
print(ans)

import math
from collections import defaultdict
N, M = list(map(int, input().split(' ')))
if M == 1:
    print(1)  # a_i = 1 for all i
    return
# prime factorization of M
fact = defaultdict(int)
for i in range(2, int(math.sqrt(M) + 1)):
    while M % i == 0:
        M //= i
        fact[i] += 1
if M != 1:
    # M is prime
    fact[M] = 1
# calculate answer
answer = 1
mod = 10**9 + 7
for f in fact.values():
    # calc combination(f + N - 1, f) = (f + N - 1) * ... * N / f!
    numerator = 1
    denominator = 1
    for i in range(f):
        numerator *= (N + i)
        denominator *= (i + 1)
    answer *= (numerator // denominator)
    answer %= mod
print(answer)

# 解説を参考に作成
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque

class FermatCmb:
    """フェルマー小定理を使用した順列, 組み合わせ計算"""

    def __init__(self, max_num, mod):
        """
        :param max_num: max n of nCk
        :param mod: any prime number
        """
        self.max_num = max_num
        self.mod = mod
        self.fact = [0 for _ in range(max_num + 1)]
        self.factinv = [0 for _ in range(max_num + 1)]

        self.fact[0] = 1
        for i in range(1, max_num + 1):
            self.fact[i] = (i * self.fact[i - 1]) % self.mod

        self.factinv[-1] = pow(self.fact[-1], mod - 2, mod)
        for i in range(max_num, 0, -1):
            self.factinv[i - 1] = self.factinv[i] * i
            self.factinv[i - 1] %= self.mod

    def nCk(self, n, k):
        return (self.fact[n] * self.factinv[k] * self.factinv[n - k]) % self.mod

    def nPk(self, n, k):
        return (self.fact[n] * self.factinv[n - k]) % self.mod


def prime_factorization(x):
    """素因数分解"""
    import math
    re = []
    i = 2
    while x != 1:
        if x % i == 0:
            re.append(i)
            x //= i
        else:
            i += 1
            if i > math.sqrt(x):
                re.append(x)
                break
    return re


# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, M):
    mod = 10 ** 9 + 7
    pf = prime_factorization(M)
    pf_map = {}
    for p in pf:
        pf_map.setdefault(p, 0)
        pf_map[p] += 1
    fc = FermatCmb(N + max(list(pf_map.values()) + [1]), mod)

    ans = 1
    for p in list(pf_map.values()):
        ans *= fc.nCk(p + N - 1, p)
        ans %= mod

    print(ans)


def __starting_point():
    N, M = list(map(int, input().split()))
    solve(N, M)

    # # test
    # from random import randint
    # from func import random_str
    # while True:
    #     N, M = randint(1, 100), randint(1,100)
    #     print(N, M)
    #     solve(N, M)

__starting_point()

import sys
sys.setrecursionlimit(10 ** 8)
MOD = 10 ** 9 + 7
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N, M = ZZ()
    MAX_E = 50

    fact = [1] * (N+MAX_E+1) # fact[n] = n!
    ifact = [1] * (N+MAX_E+1)

    for i in range(1, N+MAX_E+1):
        fact[i] = i * fact[i-1]
        fact[i] %= MOD
    ifact[N+MAX_E] = pow(fact[N+MAX_E], MOD-2, MOD)
    for i in range(N+MAX_E)[::-1]: ifact[i] = ((i+1) * ifact[i+1]) % MOD

    def combination(n, r):
        if r < 0 or r > n: return 0
        return (fact[n] * ifact[n-r] * ifact[r]) % MOD

    def prime_factor(num):
        i = 2
        ret = []
        while i*i <= num:
            if num%i != 0:
                i += 1
                continue
            cc = 0
            while num%i == 0:
                num //= i
                cc += 1
            ret.append([i, cc])
            i += 1
        if num != 1: ret.append([num, 1])
        return ret

    ps = prime_factor(M)
    ans = 1
    for p, e in ps:
        ans *= combination(N + e - 1, N - 1)
        ans %= MOD
    print(ans)

    return

def __starting_point():
    main()

__starting_point()

import sys
import math
from collections import defaultdict
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


# Nの素因数分解を辞書で返す
def prime_fact(n):
    root = int(math.sqrt(n))
    prime_dict = {}
    for i in range(2, root+1):
        cnt = 0
        while n % i == 0:
            cnt += 1
            n = n // i
        if cnt:
            prime_dict[i] = cnt
    if n != 1:
        prime_dict[n] = 1
    return prime_dict


def combination_mod_initialize(n, MOD=10**9+7):
    fac = [1]*(n+1)
    inv = [1]*(n+1)
    for i in range(1, n+1):
        fac[i] = fac[i-1] * i % MOD
        inv[i] = inv[i-1] * pow(i, -1, MOD) % MOD
    return fac, inv

# 二項係数　高速
def combination_mod(n, r, fac, inv, mod=10**9+7):
    return fac[n] * inv[r] * inv[n-r]


def main():
    N, M = NMI()
    PD = prime_fact(M)
    ans = 1
    fac, inv = combination_mod_initialize(10**6, MOD)

    for x in list(PD.values()):
        ans = ans * combination_mod(N+x-1, N-1, fac, inv) % MOD

    print(ans)



def __starting_point():
    main()
__starting_point()

MOD = 10**9 + 7
MOD_t_MAX = 3 * (10**5)

fac  = [None] * MOD_t_MAX
finv = [None] * MOD_t_MAX
inv  = [None] * MOD_t_MAX
def MOD_COM_init():
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, MOD_t_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 MOD_COM(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

def main():
    n, m = map(int, input().split())
    MOD_COM_init()
    dic = {}
    x = 2
    while m%x == 0:
        if x in dic:
            dic[x] += 1
        else:
            dic[x] = 1
        m //= x
    x = 3
    while x*x <= m:
        while m%x == 0:
            if x in dic:
                dic[x] += 1
            else:
                dic[x] = 1
            m //= x
        x += 2
    if 1 < m:
        if m in dic:
            dic[m] += 1
        else:
            dic[m] = 1
    ans = 1
    for v in dic.values():
        ans *= MOD_COM(n+v-1, v)
        ans %= MOD
    print(ans)

def __starting_point():
    main()
__starting_point()

import math
def fac(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==[]:
        arr.append([n, 1])

    return arr
def com(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
from operator import mul
from functools import reduce

def cmb(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
ans = 1
a,b = list(map(int,input().split()))
l = fac(b)
for i in l:
  ans *= cmb(i[1]+a-1,a-1)
  ans = ans % (10**9 + 7)
if b == 1:
  print((1))
else:
  print(ans)

  


n, m = list(map(int, input().split()))
mod = 10**9+7
modp = mod
max_n = 10 ** 6 + 1               # 必要分だけ用意する
fact = [1, 1] + [0]*max_n     # fact[n] = (n! mod modp)
factinv = [1, 1] + [0]*max_n  # factinv[n] = ((n!)^(-1) mod modp)
inv = [0, 1] + [0]*max_n      # factinv 計算用

def cmb(n, r, p):
    assert n < p, 'n is less than modp'
    assert n < max_n, 'n in less than max_n'
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return (fact[n] * (factinv[r] * factinv[n-r])%p) % p

for i in range(2, max_n + 1):
    fact[i] = (fact[i-1] * i) % modp
    inv[i] = (-inv[modp % i] * (modp // i)) % modp
    factinv[i] = (factinv[i-1] * inv[i]) % modp

def factorization(m):
    arr = []
    temp = m
    # 一旦負にするとceilと同じ挙動となる。//1はfloatを返すのでintが必要
    for i in range(2, int(-(-m**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==[]:
        arr.append([n, 1])
    return arr

arr = factorization(m)

ans = 1
for k, v in arr:
    temp = cmb(v+n-1, n-1, mod)
    ans = (ans * temp) % mod
if m == 1:
    print((1))
else:
    print(ans)



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


def factorization(n):
    retval = []
    tmp = n
    for i in range(2, int(-(-n**.5//1))+1):
        if tmp % i == 0:
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            retval.append((i, cnt))
    if tmp != 1:
        retval.append((tmp, 1))
    return retval


def com(n, r):
    X = Y = 1
    if n-r < r:
        r = n-r
    for i in range(1, r+1):
        Y = Y*i % MOD
        X = X*(n-i+1) % MOD
    Y = pow(Y, MOD-2, MOD)
    return X*Y


fact = factorization(m)
ans = 1
for x, p in fact:
    ans *= com(n+p-1, n-1)
print((ans % MOD))


from collections import defaultdict


def comb(n, k, mod=10 ** 9 + 7):
    denominator = 1
    numerator = 1
    for i in range(1, k + 1):
        denominator = denominator * i % mod
    for i in range(n - k + 1, n + 1):
        numerator = numerator * i % mod
    return numerator * pow(denominator, mod - 2, mod) % mod


def main():
    n, m = list(map(int, input().split()))
    factorization = defaultdict(int)
    while not m % 2:
        factorization[2] += 1
        m //= 2
    f = 3
    while f * f <= m:
        if not m % f:
            factorization[f] += 1
            m //= f
        else:
            f += 2
    if m != 1:
        factorization[m] += 1
    ans = 1
    mod = 10 ** 9 + 7
    for _, c in list(factorization.items()):
        ans *= comb(c + n - 1, c, mod)
        ans %= mod
    print(ans)


def __starting_point():
    main()

__starting_point()

import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

def factorization(n):
    prime = []
    num = n
    p = 2
    while p * p <= n:
        cnt = 0
        while num % p == 0:
            cnt += 1
            num //= p
        prime.append((p, cnt))
        p += 1
    if num != 1:
        prime.append((num, 1))
    if not prime:
        prime.append((n, 1))
         
    return prime

def nCr(n, r, mod):
    a, b = 1, 1
    for i in range(r):
        a = a * (n - i) % mod
        b = b * (i + 1) % mod
    
    return a * pow(b, mod - 2, mod) % mod

def Main():
    n, m = read_ints()
    prime = factorization(m)
    ans = 1
    for p, num in prime:
        ans *= nCr(num + n - 1, num, MOD)
        ans %= MOD
    
    if m == 1:
        print(1)
    else:
        print(ans)

def __starting_point():
    Main()
__starting_point()

import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n,m = list(map(int,ipt().split()))
    d = dict()
    mod = 10**9+7
    p = primes(m)
    for i in p:
        t = 0
        while True:
            if m%i == 0:
                m //= i
                t += 1
            else:
                break
        if t > 0:
            d[i] = t
        if i > m:
            break
    if m > 1:
        d[m] = 1
    ans = 1

    #nCrをmodで割った余りを求める。Nに最大値を入れて使用。
    N = 10**5+1000
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    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
    for i in range(2,N+1):
        g1.append((g1[-1]*i)%mod)
        inverse.append((-inverse[mod % i]*(mod//i))%mod)
        g2.append((g2[-1]*inverse[-1])%mod)

    for i in list(d.values()):
        ans = (ans*cmb(n-1+i,i,mod))%mod

    print(ans)

    return

#√nまでの素数の配列を返す関数
def primes(n):
    if n < 4:
        return []
    else:
        pri = [2]
        k = 3
        while k*k <= n:
            for i in pri:
                if k%i == 0:
                    break
                elif i == pri[-1]:
                    pri.append(k)
            k += 2
        return pri

def __starting_point():
    main()

__starting_point()

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)


from collections import Counter
from functools import reduce
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 pow_k(x, n):
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K = (K * x)
        x = (x * x)
        n //= 2
    return (K * x)
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0
def modinv(a, m):
    g, x, y = xgcd(a, m)
    return x % m
def modmul(a,b):
    return a * b % 1000000007
def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(modmul, range(n, n - r, -1))
    under = reduce(modmul, range(1,r + 1))
    return over * modinv(under, 1000000007)

N,M = (int(x) for x in input().split())
ans = 1
if M == 1:
    print('1')
else:
    a = Counter(prime_factorize(M))
    for x in a.values():
        ans = ans * comb(N+x-1,x) % 1000000007
    print(ans)

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, N*2 + 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 - 選んだ数））
if N == 1:
    print((1))
    return
ans = 1

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

print(ans)


P = 10**9 + 7

def modpow(a, n):
    if n == 0:
        return 1
    if n % 2 == 0:
        return (modpow(a, n // 2)**2) % P
    else:
        return (a * modpow(a, n // 2)**2) % P

def inv(a):
    return modpow(a, P - 2)

fac = [1]*(2*10**5)
for i in range(1, 2*10**5):
    fac[i] = (i * fac[i - 1]) % P

primes = []
check = [False]*10**5
for p in range(2, 10**5):
    if check[p]:
        continue
    primes.append(p)
    for j in range((10**5 - 1) // p + 1):
        check[p * j] = True

def pf(M):
    ans = {}
    for p in primes:
        e = 0
        while M % p == 0:
            M //= p
            e += 1
        if e > 0:
            ans[p] = e
    if M > 1:
        ans[M] = 1
    return ans

N, M = map(int, input().split())
pfM = pf(M)

ans = 1
for p in pfM:
    e = pfM[p]
    dup = (fac[e + N - 1] * inv(fac[e]) * inv(fac[N - 1])) % P
    ans = (ans * dup) % P
print(ans)

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==[]:
        arr.append([n, 1])

    return arr

from scipy.special import comb
n, m = map(int, input().split())
a = factorization(m)
M = 10**9 + 7

ans = 1
if m == 1:
    print(1)
    return
for i in a:
    ans *= comb(n, i[1], exact=True, repetition=True)
    ans = ans%M
print(ans)

N,M = map(int,input().split())
ans = int(M**0.5+10)*[N-1]
mod = 10**9+7
p = 2
O = M

while p<=O**0.5:
  if M%p == 0:
    M = M//p
    ans[p] += 1
  else:
    p+=1
    
if M!=1:
  ans[-1]+=1

out = 1
for r in ans:
  hoge = 1
  for i in range(min(N-1,r-N+1)):
    hoge*=r-i
    hoge//=i+1
  out*=hoge
  out%=mod

print(out)

N,M=map(int,input().split())
MOD=10**9+7
 
def cmb(n, r, p):
  numerator = 1
  for i in range(n-r+1, n+1):
    numerator = numerator * i % p
  denominator = 1
  for j in range(1, r+1):
    denominator = denominator * j % p
  denominator = pow(denominator, p-2, p)
  return (numerator * denominator)%p
 
def factorization(n):
  l = []
  t = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if t%i==0:
      cnt=0
      while t%i==0:
        cnt+=1
        t //= i
      l.append([i, cnt])
  if t!=1:
    l.append([t, 1])
  if l==[]:
    l.append([n, 1])
  return l
 
ans=1
F=factorization(M)
for i in range(len(F)):
  f=F[i][1]
  ans*=cmb(f+N-1,f,MOD)
  ans%=MOD

if M==1:
  print(1)
else:
  print(ans)

MOD = 10**9 + 7
class mint:
    def __init__(self, i):
        self.i = i
    def __add__(self, m):
        t = self.i + (m.i if isinstance(m, mint) else m)
        if t > MOD:
            t -= MOD
        return mint(t)
    def __radd__(self, m):
        t = self.i + (m.i if isinstance(m, mint) else m)
        if t > MOD:
            t -= MOD
        return mint(t)
    def __mul__(self, m):
        return mint(self.i * (m.i if isinstance(m, mint) else m) % MOD)
    def __sub__(self, m):
        t = self.i - (m.i if isinstance(m, mint) else (m % MOD))
        if t < 0:
            t += MOD
        return mint(t)
    def __pow__(self, m):
        i = self.i
        return mint(pow(i, m, MOD))
    def __truediv__(self, m):
        return mint(self.i * pow(m, MOD - 2, MOD) % MOD)
    def __repr__(self):
        return repr(self.i)

fact_range = 10**6
facts = [1] * (fact_range + 1)
for i in range(0, fact_range):
    facts[i+1] = facts[i] * (i + 1) % MOD

ifacts = [1] * (fact_range + 1)
ifacts[fact_range] = pow(facts[fact_range], MOD - 2, MOD)
for i in range(fact_range, 0, -1):
    ifacts[i-1] = ifacts[i] * i % MOD

def comb(n, k):
    if k < 0 or n < k:
        return 0
    else:
        return facts[n] * ifacts[n-k] % MOD * ifacts[k] % MOD

n, m = list(map(int, input().split()))
d = []
p = 2
while p < 10 ** 5:
    cnt = 0
    while m % p == 0:
        m //= p
        cnt += 1
    if cnt > 0:
        d.append(cnt)
    p += 1
if m > 1:
    d.append(1)
ans = mint(1)
for c in d:
    ans *= comb(n - 1 + c, c)
print(ans)


from collections import defaultdict

def prime_factors(n):
    d = defaultdict(int)
    while n%2 == 0:
        d[2] += 1
        n //= 2
    i = 3
    while i*i <= n:
        while n%i == 0:
            d[i] += 1
            n //= i
        i += 2
    if n > 2:
        d[n] += 1
    return d

# Combination
MOD = 10**9+7
MAX = 2*10**5
fac = [1,1] + [0]*MAX
finv = [1,1] + [0]*MAX
inv = [0,1] + [0]*MAX
for i in range(2,MAX+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

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

N, M = list(map(int, input().split()))
ans = 1
pf = prime_factors(M)
for k,v in list(pf.items()):
    ans *= comb(v+N-1, N-1)
    ans %= MOD
print(ans)


#!/usr/bin/env python3
import sys


MOD = 1000000007  # type: int


def factor(n: int):
    i = 2
    cnt = 0
    while n % i == 0:
        n //= i
        cnt += 1
    if cnt > 0:
        yield i, cnt

    i = 3
    while i * i <= n:
        cnt = 0
        while n % i == 0:
            n //= i
            cnt += 1
        if cnt > 0:
            yield i, cnt
        i += 2

    if n > 1:
        yield n, 1


def comb(n: int, r: int):
    if n - r < r:
        return comb(n, n - r)
    ans = 1
    for i in range(r):
        ans *= n - i
    for i in range(r):
        ans //= i + 1
    return ans


def solve(N: int, M: int):
    ans = 1
    for _p, cnt in factor(M):
        ans *= comb(N - 1 + cnt, cnt) % MOD
        ans %= MOD
    print(ans)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    solve(N, M)


def __starting_point():
    main()

__starting_point()

import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
class Counting():
    def __init__(self,maxim,mod):
        maxim += 1

        self.mod = mod
        self.fact = [0]*maxim
        self.fact[0] = 1
        for i in range(1,maxim):
            self.fact[i] = self.fact[i-1] * i % mod

        self.invfact = [0]*maxim
        self.invfact[maxim-1] = pow(self.fact[maxim-1],mod-2,mod)
        for i in reversed(range(maxim-1)):
            self.invfact[i] = self.invfact[i+1] * (i+1) % mod


    def nCk(self,n,r):
        if n < 0 or n < r: return 0
        return self.fact[n] * self.invfact[r] * self.invfact[n-r] % self.mod

    def nPk(self,n,r):
        if n < 0 or n < r: return 0
        return self.fact[n] * self.invfact[n-r] % self.mod

        

def main():
    N,M=mi()
    MOD=10**9+7

    if N == 1:
        print(1)
        return
    
    def prime_factorize(n):
        P = []
        P_set = set()
        while n % 2 == 0:
            P.append(2)
            P_set.add(2)
            n //= 2
        f = 3
        while f * f <= n:
            if n % f == 0:
                P.append(f)
                P_set.add(f)
                n //= f
            else:
                f += 2
        if n != 1:
            P.append(n)
            P_set.add(n)

        P_count = {p:0 for p in P_set}
        for p in P: P_count[p] += 1

        return P_count


    
    ans = 1
    counting = Counting(3*10**5+10,MOD)
    for p,e in prime_factorize(M).items():
        ans *= counting.nCk(e+N-1,e)
        ans %= MOD

    
    print(ans % MOD)



def __starting_point():
    main()
__starting_point()

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


import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
MOD = 10 ** 9 + 7
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def primeFactorization(n):
    ans = []
    temp = n
    while temp%2 == 0:
        ans.append(2)
        temp //= 2
    for i in range(3, int(n**0.5)+1, 2):
        while temp%i == 0:
            ans.append(i)
            temp //= i
    if temp > 1:
        ans.append(temp)
    return collections.Counter(ans)

def combMod(n, r, p):
    numer = 1
    denom = 1
    for i in range(1, r+1):
        numer = numer * (n-r+i) % p
        denom = denom * i % p
    return numer * pow(denom, p-2, p) % p

def resolve():
    N, M = LI()

    pf = primeFactorization(M)
    # 素因数ごとに、N個のグループにどう振り分けるかを計算する
    ans = 1
    for i in list(pf.values()):
        ans *= combMod(i + N - 1, i, MOD)        
        ans %= MOD

    print(ans)

def __starting_point():
    resolve()

__starting_point()

def prime_factor(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 == []:
        arr.append([n, 1])
    return arr


MOD = 10**9+7
lim = 200000
inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]


def set_inv(max=lim):
    inv_t[0] = 0
    for i in range(1, max):
        inv_t[i] == mod_inv(i)


def mod_inv(x, mod=MOD):
    y, u, v, _x = mod, 1, 0, x
    while y:
        t = _x//y
        _x -= t*y
        _x, y = y, _x
        u -= t*v
        u, v = v, u
    u %= mod
    if u < 0:
        u += mod
    return u


def mod_pow(a, n, mod=MOD):
    res = 1
    while n:
        if n & 1:
            res = res*a % mod
        a = a*a % mod
        n >>= 1
    return res


def set_factrial(max=lim, mod=MOD):
    c = 1
    factrial[0] = factrial_inv[0] = 1
    for i in range(1, max):
        c *= i
        c %= mod
        factrial[i] = c
        factrial_inv[i] = mod_inv(c, mod)


def comb(a, b, mod=MOD):
    if factrial[0] == -1:
        set_factrial()
    return (factrial[a]*factrial_inv[b]*factrial_inv[a-b]) % mod


n, m = [int(_) for _ in input().split()]
ans = 1
for p, e in prime_factor(m):
    ans *= comb(n-1+e, e)
    ans %= MOD
if m==1:
    ans=1
print(ans)


import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return list(map(int, input().split()))
def MI1(): return list(map(int1, input().split()))
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print((k.join(list(map(str, lst)))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5))+1):
        if n % i: continue
        ex = 0
        while n % i == 0:
            n = n // i
            ex += 1
        res.append((i, ex))
    if n != 1:
        res.append((n, 1))
    return res

def mcomb(n, k, mod):
    def mfac(l, r, mod):
        ans = l
        for i in reversed(list(range(r, l))):
            ans *= i
            ans %= mod
        return ans

    A = mfac(n, n-k+1, mod)
    B = mfac(k, 1, mod)
    # B = mpow(B,mod-2,mod)
    B = pow(B, mod-2, mod)
    return A * B % mod

def solve():
    N, M = MI()
    fact = prime_factorization(M)
    MOD = 1000000007

    if N == 1:
        print((1))
        return

    ans = 1
    for num, ex in fact:
        ans = ans * mcomb(ex+N-1, N-1, MOD)
        ans %= MOD
    print(ans)


def __starting_point():
    solve()

__starting_point()

#!/usr/bin python3
# -*- coding: utf-8 -*-

def factorization(n):
    primen, degree, primend = [], [], []
    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
            primen.append(i)
            degree.append(cnt)
            primend.append([i,cnt])
    if temp!=1:
        primen.append(temp)
        degree.append(1)
        primend.append([temp,1])
    if primen==[]:
        primen.append(n)
        degree.append(1)
        primend.append([n,1])
    return degree
#    return primen,degree


def main():
    N, M = map(int, input().split())
    if M == 1:
        print(1)
    else:
        mod = 10**9+7               # mod素数
        Mf = factorization(M)
        l = max(Mf)
        Comb=[1]*(l+1)
        for i in range(1,l+1):
            tmp = Comb[i-1]
            tmp *= N-1+i
            tmp *= pow(i, mod-2, mod)
            Comb[i] = tmp%mod
        ret = 1
        for i in Mf:
            ret *= Comb[i]
            ret %= mod
        print(ret)



def __starting_point():
    main()
__starting_point()

from collections import defaultdict

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

prime_list = defaultdict(int)
p = 2
while p <= 10**4.5+5:
    if m%p == 0:
        prime_list[p] += 1
        m //= p
    else:
        p += 1

if m > 1:
    prime_list[m] += 1

MOD=10**9+7

def comb(n, r): 
    if r<0 or r>n: 
        return 0
    r=min(r, n-r)
    res=1
    for i in range(r): 
        res=res*(n-i)%MOD*pow(i+1, MOD-2, MOD)%MOD
    return res

ans = 1
for k in prime_list.keys():
    ans *= comb(prime_list[k]+n-1, prime_list[k])
    ans %= MOD

print(ans)

from collections import defaultdict


def factorize(n):
    facts = defaultdict(int)
    while n % 2 == 0:
        n //= 2
        facts[2] += 1
    m = 3
    while m * m <= n:
        while n % m == 0:
            facts[m] += 1
            n //= m
        m += 2
    if 1 < n:
        facts[n] += 1
    return facts


MOD = 10 ** 9 + 7  # should be a prime number
MAX = 10 ** 5 + 100
FACTS = [1] * (MAX + 1)
for i in range(1, MAX + 1):
    FACTS[i] = FACTS[i - 1] * i % MOD
FACTINVS = [1] * (MAX + 1)
INVS = [1] * (MAX + 1)
for i in range(2, MAX + 1):
    q, r = divmod(MOD, i)
    INVS[i] = -INVS[r] * q % MOD
    FACTINVS[i] = FACTINVS[i - 1] * INVS[i] % MOD


def nCr(n, r):
    return FACTS[n] * FACTINVS[r] * FACTINVS[n - r]


N, M = map(int, input().split())
factors = factorize(M)
ans = 1
for p, e in factors.items():
    ans = ans * nCr(N - 1 + e, e) % MOD
print(ans)

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==[]:
        arr.append([n, 1])
    return arr
  
n,m = map(int,input().split())
chk = factorization(m)

def make_array_for_comb(N, mod=10**9+7):
    fact = [1,1]
    fact_inv = [1,1]
    inv = [0,1]
    for i in range(2, N+1):
        fact.append((fact[-1]*i) % mod)
        inv.append((-inv[mod%i] * (mod//i)) % mod)
        fact_inv.append((fact_inv[-1]*inv[i]) % mod)
    return fact, fact_inv

def comb(n, r, mod=10**9+7):
  if (r < 0) or (n < r):
      return 0
  r = min(r, n - r)
  return fact[n] * fact_inv[r] * fact_inv[n-r] % mod

mod = 10**9+7
ans = 1
for i in chk:
  fact, fact_inv = make_array_for_comb(i[1]+n-1,mod)
  ans *= comb(i[1]+n-1,i[1],mod)
  ans %= mod
if m == 1:
  ans = 1
print(ans)

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)




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

def pfact(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 cmb(n, r, p):
	if (r < 0) or (n < r):
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % p

N = 3 * 10 ** 5  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
	fact.append((fact[-1] * i) % p)
	inv.append((-inv[p % i] * (p // i)) % p)
	factinv.append((factinv[-1] * inv[-1]) % p)

#テンプレ終わり

if m == 1:
	print(1)
	return

factlist = pfact(m).values()

ans = 1

for i in factlist:
	ans = ans * cmb(i+n-1,i,p) % p

print(ans % p)

from collections import Counter
from functools import reduce
import operator
product = lambda it: reduce(operator.mul,it,1)

def comb(n, max_k, mod):
    """
    (n,k) := n個からk個選ぶ組み合わせ
    k = 0~max_Kまでを計算して返す
    """
    res = [1]*(max_k+1)
    t = 1
    for i in range(max_k+1):
        res[i] *= t
        t *= n-i
        t %= mod

    n = reduce(lambda x,y: (x*y)%mod, range(1,max_k+1), 1)
    n = pow(n, mod-2, mod)

    for i in reversed(range(max_k+1)):
        res[i] *= n
        res[i] %= mod
        n *= i
        n %= mod
    return res

# 素因数分解
def prime_factors(n):
    i = 2
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            yield i
    if n > 1:
        yield n

MOD = 10**9+7
N,M = map(int,input().split())

factors = Counter(prime_factors(M))

res = 1

for c in factors.values():
    res *= comb(N-1+c,c,MOD)[-1]
    res %= MOD

print(res)

#!/usr/bin/env python3

from collections import Counter
from scipy.special import comb

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


c = Counter(prime_factorize(m))

ans = 1
for key, value in list(c.items()):
    ans *= comb(value+n-1, value, exact=True) % mod
print((ans % mod))


N, M = list(map(int, input().split()))
MOD = 10 ** 9 + 7
# 素因数分解 O(√N)


def prime_decomposition(n):
    i = 2
    prime2exponent = {}  # key:prime --> value:its exponent
    while i*i <= n:
        while n % i == 0:
            n //= i
            if i in prime2exponent:
                prime2exponent[i] += 1
            else:
                prime2exponent[i] = 1
        i += 1
    if n > 1:
        if n in prime2exponent:
            prime2exponent[n] += 1
        else:
            prime2exponent[n] = 1
    return prime2exponent


class Combination:
    """
  O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
  n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
  使用例：
  comb = Combination(1000000)
  print(comb(5, 3))  # 10
  """

    def __init__(self, n_max, mod=10 ** 9 + 7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n - r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n + 1):
            fac.append(fac[i - 1] * i % self.mod)
            facinv.append(facinv[i - 1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n + 1)
        modinv[1] = 1
        for i in range(2, n + 1):
            modinv[i] = self.mod - self.mod // i * \
                modinv[self.mod % i] % self.mod
        return modinv


comb = Combination(1000000)
pd = prime_decomposition(M)
ans = 1
for v in list(pd.values()):
    c = comb(N + v - 1, N-1)
    ans = ans * c % MOD
print(ans)


class Calc:
    def __init__(self, max_value, mod):
        """combination(max_value, all)"""
        fact = [-1] * (max_value + 1)
        fact[0] = 1
        fact[1] = 1
        for x in range(2, max_value + 1):
            fact[x] = x * fact[x - 1] % mod

        invs = [1] * (max_value + 1)
        invs[max_value] = pow(fact[max_value], mod - 2, mod)
        for x in range(max_value - 1, 0, -1):
            invs[x] = invs[x + 1] * (x + 1) % mod

        self.fact = fact
        self.invs = invs
        self.mod = mod

    def combination(self, n, r):
        if n - r < r:
            return self.combination(n, n - r)
        if r < 0:
            return 0
        if r == 0:
            return 1
        if r == 1:
            return n
        return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod


def main():
    MOD = 10 ** 9 + 7

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

    def decom(n) -> list:  # 恐らく因数分解がTLEの原因->1/2乗で打ち切り
        ret = []

        x = n
        d = 2
        cnt = 0
        while x % d == 0:
            x //= d
            cnt += 1
        ret.append(cnt)

        d = 3
        while d * d <= n:
            cnt = 0
            while x % d == 0:
                x //= d
                cnt += 1
            ret.append(cnt)
            d += 2

        if x > 1:
            ret.append(1)

        return ret

    dlis = decom(M)

    cal = Calc(max_value=N + 30, mod=MOD)

    ans = 1
    for cnt in dlis:
        ans = (ans * cal.combination(N + cnt - 1, cnt)) % MOD
    print(ans)


def __starting_point():
    main()

__starting_point()

MOD = 10**9+7

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

primes = [0]
while M % 2 == 0:
    primes[0] += 1
    M //= 2

if M != 1:
    for i in range(3, int(M**0.5+1), 2):
        if M % i == 0:
            primes.append(0)
            while M % i == 0:
                primes[-1] += 1
                M //= i
            if M == 1:
                break
    else:
        primes.append(1)

#combinations[p] = p+N-1 C N-1
combinations = [1]

p_max = max(primes)
for p in range(1, p_max+1):
    combinations.append( combinations[-1] * (p+N-1) * pow(p, MOD-2, MOD) % MOD )

ans = 1
for p in primes:
    ans *= combinations[p]
    ans %= MOD

print(ans)

from collections import Counter


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 main():
    N, M = map(int, input().split())

    MOD = 10**9 + 7
    

    MAX_N = 5 * (10 ** 5)
    # comb init
    fac = [0] *  MAX_N
    finv = [0] *  MAX_N 
    inv = [0] *  MAX_N

    fac[0] = 1; fac[1] = 1
    finv[0] = 1; finv[1] = 1
    inv[1] = 1

    for i in range(2, MAX_N):
        fac[i] = fac[i-1] * i % MOD
        inv[i] = -inv[MOD%i] * (MOD//i) % MOD
        finv[i] = finv[i-1] * inv[i] % MOD
    
    def COM(n, k):
        if n < k : return 0
        if n < 0 or k < 0 : return 0
        return (fac[n] * finv[n-k] % MOD) * finv[k] % MOD

    
    pf = prime_factorize(M)
    pc = Counter(pf)

    ans = 1
    for _, val in pc.items():
        ans *= COM(val + N - 1, N - 1)
        ans %= MOD
    print(ans)


def __starting_point():
    main()
__starting_point()

#素因数分解して列挙する関数、約数列挙ではない！
from collections import Counter
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    fct = Counter(fct)
    return fct

mod = 10**9+7
def comb_mod(n,r,mod):
    ans = 1
    for i in range(r):
        ans *= n-i
        ans %= mod
    for i in range(1,r+1):
        ans *= pow(i,mod-2,mod)
        ans %= mod
    return ans

N, M = map(int, input().split())
fact = factorize(M)
ans = 1
for k in fact.values():
    ans *= comb_mod(k+N-1,k,mod)
    ans %= mod
print(ans)

def prime_factor(n):
    if n == 1:
        return [[1, 0]]
    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 == []:
        arr.append([n, 1])
    return arr


MOD = 10**9+7
lim = 200000
inv_t = [-1 for i in range(lim+1)]
factrial = [-1 for i in range(lim+1)]
factrial_inv = [-1 for i in range(lim+1)]


def set_inv(max=lim):
    inv_t[0] = 0
    for i in range(1, max):
        inv_t[i] == mod_inv(i)


def mod_inv(x, mod=MOD):
    y, u, v, _x = mod, 1, 0, x
    while y:
        t = _x//y
        _x -= t*y
        _x, y = y, _x
        u -= t*v
        u, v = v, u
    u %= mod
    if u < 0:
        u += mod
    return u


def mod_pow(a, n, mod=MOD):
    res = 1
    while n:
        if n & 1:
            res = res*a % mod
        a = a*a % mod
        n >>= 1
    return res


def set_factrial(max=lim, mod=MOD):
    c = 1
    factrial[0] = factrial_inv[0] = 1
    for i in range(1, max):
        c *= i
        c %= mod
        factrial[i] = c
        factrial_inv[i] = mod_inv(c, mod)


def comb(a, b, mod=MOD):
    if factrial[0] == -1:
        set_factrial()
    return (factrial[a]*factrial_inv[b]*factrial_inv[a-b]) % mod


n, m = [int(_) for _ in input().split()]
ans = 1
for p, e in prime_factor(m):
    ans *= comb(n-1+e, e)
    ans %= MOD
print(ans)


'''h2d5
ポイントは重複組み合わせ（仕切りと中身）と素因数因数分解
N+素因数分解の指数-1から指数を選ぶ組み合わせ（指数-1が仕切りの枚数）
nPr=n!/(n-r)!   
nCr=n!/(n-r)!*r!=(n*(n-1)*...*(n-r+1))/r!(分子分母は共にｒ個)
'''
import math
MOD=10**9+7

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

N,M=map(int,input().split())
fact={}
for i in range(2,int(math.sqrt(M))+1):
  if M==1:
    break
  while(M%i==0):#エラトステネスの篩
    M//=i
    if not i in fact:#素因数がなければ追加
      fact[i]=1
    else:#素因数があれば増加
      fact[i]+=1  
if M!=1:#素数のケース
  fact[M]=1
  
answer=1
for r in fact.values():
  answer*=comb(N+r-1,r)#重複組み合わせ
  answer%=MOD
  
print(answer)


def resolve():
    # nCk = n! / n!(n-k)! のテーブル作成
    def COMinit(n, MOD):
        fact = [1, 1]
        fact_inv = [1, 1]
        inv = [0, 1]
        for i in range(2, n + 1):
            fact.append((fact[-1] * i) % MOD)
            inv.append((-inv[MOD % i] * (MOD // i)) % MOD)
            fact_inv.append((fact_inv[-1] * inv[i]) % MOD)
        return fact, fact_inv

    # 二項係数計算
    def Combination(n, k, MOD=10 ** 9 + 7):
        fac, finv = COMinit(n, MOD)
        if n < k: return 0
        if n < 0 or k < 0: return 0
        ret = fac[n] * finv[k] * finv[n - k] % MOD
        return ret

    #指数:exponent
    def dic_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 == []:
            arr.append([n, 1])
        return arr

    MOD = 10**9+7
    N, M = map(int, input().split())
    if M==1:
        print(1)
        return
    
    fact = dic_factorization(M)
    ans = 1
    for v in fact:
        ans *= Combination(N+v[1]-1, v[1])
        ans %= MOD

    print(ans)

def __starting_point():
    resolve()
__starting_point()

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

import math

def prime_fac(n):
  p_lis = []
  temp = n

  for i in range(2, int(math.sqrt(n)) + 1):
    if temp % i == 0:
      cnt = 0
      while temp % i == 0:
        cnt += 1
        temp //= i
      p_lis.append([i, cnt])
  if temp != 1:
    p_lis.append([temp, 1])
  if p_lis == []:
    p_lis.append([n, 1])

  return p_lis

mod = 10 ** 9 + 7
MAX = N + 50
fac = [1, 1]
finv = [1, 1]
inv = [0, 1]

def comb(n, r):
  if n < r:
    return 0
  else:
    return fac[n] * ( finv[r] * finv[n-r] % mod ) % mod
 
for i in range(2, MAX + 1):
  fac.append( ( fac[-1] * i ) % mod )
  inv.append( mod - ( inv[mod % i] * (mod // i) % mod ) )
  finv.append( finv[-1] * inv[-1]  % mod )

ans = 1

for p, a in prime_fac(M):
  if a == p == 1:
    break
  ans *= comb(N+a-1, a)
  ans %= mod

print(ans)

def nCr(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
 
mod = 10**9+7 #出力の制限
size = 10**6 # size >= n
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
 
for i in range( 2, size + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
 
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(cnt)
 
    if temp!=1:
        arr.append(1)
 
    return arr
 
N, M = map(int,input().split())
L = factorization(M)
 
ans = 1
 
for i in L:
    ans *= nCr(i+N-1,N-1,mod)
    ans %= mod
 
print(ans)

import collections
import math
from operator import mul
from functools import reduce
N,M = list(map(int,input().split()))

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):
    r = min(r, n - r)
    numer = reduce(mul, list(range(n, n - r, -1)), 1)
    denom = reduce(mul, list(range(1, r + 1)), 1)
    return numer // denom

c = collections.Counter(prime_factorize(M))
primeFactorizeList = list(c.values())
answer = 1
for i in primeFactorizeList:
    answer *= combinations_count(i+N-1, i)
    answer = answer % (10 ** 9 + 7)
print((int(answer)))


import collections,sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,M = LI()
ans = 1
def prime_factor(num):
    prime_factor = collections.defaultdict(int)
    for i in range(2,int(num**0.5)+1):
        while num%i==0:
            prime_factor[i] += 1
            num //= i
    if num>1:
        prime_factor[num]=1
    return prime_factor
def nCr(n,r,mod):
    comb_count = 1
    for i in range(r):
        comb_count *= n-i
        comb_count %= mod
    for i in range(1,r+1):
        comb_count *= pow(i,mod-2,mod)
        comb_count %= mod
    return comb_count
for v in list(prime_factor(M).values()):
    ans *= nCr(v+N-1,v,10**9+7)
    ans %= 10**9+7
print(ans)


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 + 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 - 選んだ数））
if N == 1:
    print((1))
    return
ans = 1

for p, cnt in primes:
    tmp = 0
    for i in range(1, min(cnt, N)+1):
        tmp += cmb(N, i, mod) * cmb(cnt-1, i-1, mod)
        #print(tmp, p, cnt, i)
        tmp %= mod
    ans *= tmp
    ans %= mod

print(ans)


def factorization(n):
    arr = dict()
    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[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if not arr and n != 1:
        arr[n] = 1

    return arr


MOD = 10 ** 9 + 7
MAX = 10 ** 5 + 50
modinv = lambda a, mod=10 ** 9 + 7: pow(a, mod - 2, mod)
fac, inv = [1] * MAX, [1] * MAX
for i in range(1, MAX):
    fac[i] = fac[i - 1] * i % MOD
    inv[i] = modinv(fac[i])
comb = lambda n, k: fac[n] * inv[k] * inv[n - k] % MOD

N, M = list(map(int, input().split()))
ans = 1
for v in list(factorization(M).values()):
    ans = (ans * comb(N + v - 1, v) % MOD)
print(ans)


mod=10**9+7
dic={}
def ADD(x):
	if x in dic:
		dic[x]+=1
	else:
		dic[x]=1
n,m=list(map(int,input().split()))
for i in range(2,int(m**0.5+2)):
	while m%i==0:
		ADD(i)
		m//=i
if m>1:
	ADD(m)
dic=tuple(dic.values())
ans=1
fac=[1]
for i in range(10**6):
	fac.append(fac[-1]*(i+1)%mod)
def c(a,b):
	r=pow(fac[b]*fac[a-b]%mod,mod-2,mod)
	return fac[a]*r%mod
for x in dic:
	ans*=c(x+n-1,x)
	ans%=mod
print(ans)


N,M=map(int,input().split())
mod=10**9+7

def nCmMOD(A,B,Mod):
    num,den=1,1
    for i in range(B):
        num*=(A-i)
        den*=(i+1)
        num%=Mod
        den%=Mod
    return (num*pow(den,Mod-2,Mod))%Mod

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==[]:
        arr.append([n, 1])
    return arr

ans=1
F=factorization(M)
for i in range(len(F)):
    f=F[i][1]
    ans*=nCmMOD(f+N-1,f,mod)
    ans%=mod

if M==1:
    print(1)
else:
    print(ans)

def prime_factorizarion(n):
	arr = []
	temp = n
	for i in range(2, int(n**0.5)+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==[]:
		arr.append([n,1])
	
	return arr

def modInv(a,mod):
    return pow(a,mod-2,mod)

def nCr(n,r,mod):
    r=min(r,n-r)
    if r==0:
        return 1
    if r==1:
        return n
    numer=1
    denom=1
    for i in range(r):
        numer=(n-i)*numer%mod
        denom=(i+1)*denom%mod
    return numer*modInv(denom,mod)%mod

mod=10**9+7
N,M=map(int,input().split())

if M==1:
    print(1)
    return

prime_divisors=prime_factorizarion(M)
ans=1
for prime,num in prime_divisors:
    ans=(ans*nCr(num+N-1,num,mod))%mod
print(ans)

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

import math

def prime_fac(n):
  p_lis = []
  temp = n

  for i in range(2, int(math.sqrt(n)) + 1):
    if temp % i == 0:
      cnt = 0
      while temp % i == 0:
        cnt += 1
        temp //= i
      p_lis.append([i, cnt])
  if temp != 1:
    p_lis.append([temp, 1])
  if p_lis == []:
    p_lis.append([n, 1])

  return p_lis

mod = 10 ** 9 + 7
MAX = 10 ** 6
fac = [1, 1]
finv = [1, 1]
inv = [0, 1]

def comb(n, r):
  if n < r:
    return 0
  else:
    return fac[n] * ( finv[r] * finv[n-r] % mod ) % mod
 
for i in range(2, MAX + 1):
  fac.append( ( fac[-1] * i ) % mod )
  inv.append( mod - ( inv[mod % i] * (mod // i) % mod ) )
  finv.append( finv[-1] * inv[-1]  % mod )

ans = 1

for p, a in prime_fac(M):
  if a == p == 1:
    break
  ans *= comb(N+a-1, a)
  ans %= mod

print(ans)

from math import floor, sqrt
from collections import defaultdict
N,M = 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 d.values():
    ans *= comb(N+e-1, e)
print(ans % (10**9+7))

N,M = map(int,input().split())
MOD = 10**9+7

MAXN = N+100
fac = [1,1] + [0]*MAXN
finv = [1,1] + [0]*MAXN
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD
def comb(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

from collections import Counter
def factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d

ans = 1
f = factorize(M)
for v in f.values():
    c = comb(N+v-1, v)
    ans *= c
    ans %= MOD
print(ans)

import sys

MOD = 10 ** 9 + 7
# MOD = 998244353
def make_tables(n=10 ** 9, r=2 * 10 ** 6, p=MOD):
  fac = [None] * (r + 1); fac[0] = 1
  for i in range(r): fac[i+1] = fac[i] * (i + 1) % p
  ifac = [None] * (r + 1); ifac[r] = pow(fac[r], p - 2, p)
  for i in range(r, 0, -1): ifac[i-1] = ifac[i] * i % p
  n_choose = [None] * (r + 1); n_choose[0] = 1
  for i in range(r): n_choose[i+1] = n_choose[i] * (n - i) % p
  for i in range(r + 1): n_choose[i] = n_choose[i] * ifac[i] % p
  return fac, ifac, n_choose

fac, ifac, n_choose = make_tables()

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

def nHr(n, r, p=MOD):
  return fac[n-1+r] * ifac[n-1] % p * ifac[r] % p

def sieve_of_eratosthenes(n=10 ** 6):
  sieve = [1] * (n + 1); sieve[0] = sieve[1] = 0
  for i in range(2, int(n ** 0.5) + 1):
    if not sieve[i]: continue
    for j in range(i * 2, n + 1, i): sieve[j] = 0
  prime_numbers = [i for i in range(2, n + 1) if sieve[i]]
  return sieve, prime_numbers

is_prime, prime_numbers = sieve_of_eratosthenes()

def prime_factorize(n):
  res = dict()
  if n < 2: return res
  border = int(n ** 0.5)
  for p in prime_numbers:
    if p > border: break
    while n % p == 0: res[p] = res.get(p, 0) + 1; n //= p
    if n == 1: return res
  res[n] = 1
  return res

def prime_factorize_factorial(n):
  res = dict()
  for i in range(2, n + 1):
    for p, c in prime_factorize(i).items(): res[p] = res.get(p, 0) + c
  return res

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

def main():
  res = 1
  for p, c in prime_factorize(m).items():
    res *= nHr(n, c)
    res %= MOD 
  print(res)

def __starting_point():
  main()
__starting_point()

#素因数分解
def soinsu_bunkai(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

# 組み合わせの総数 p=10**9+7 で割ったあまりを求める Satoooh Blog 2020/02/27 4分 
"""n<10**7 , p は素数"""
def cmb(n, r, p):

    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p



# 初期入力
from collections import Counter
import sys
input = sys.stdin.readline  #文字列では使わない
mod =10**9 +7
p =mod
N,M = map(int, input().split())
a =soinsu_bunkai(M)
ans =1

n = 10 **5 +100  # n は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

#mod p における n の逆元の計算
for i in range(2, n + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

for i in a.values():
    x =cmb(N +i -1,i,mod)
    ans *=x
print(ans %mod)

n,m=map(int,input().split())
mod=pow(10,9)+7
if m==1:
  print(1)
  return
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==[]:
    arr.append([n, 1])
  return arr

# コンビネーション、さらに高速。あらかじめO(N)の計算をすることでのちの計算が早くなる
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+30+1):
  g1.append((g1[-1]*i)%mod)
  inverse.append((-inverse[mod%i]*(mod//i))%mod)
  g2.append((g2[-1]*inverse[-1])%mod)

l=factorization(m)
ans=1
for li in l:
  b=li[1]
  ans*=cmb(b+n-1,n-1,mod)
  ans%=mod
print(ans)