import math



def prime_factorize(n):

    ret = []

    # 小さい素数から順に試し割りしていく

    for i in range(2, int(math.sqrt(n))+1):

        if n % i != 0:

            continue

        e = 0

        while n % i == 0:

            e += 1

            n //= i

        ret += [(i, e)]



    if n != 1:

        ret += [(n, 1)]



    return ret





def extgcd(a, b):

    x,y, u,v = 0,1, 1,0

    while a != 0:

        q, r = b//a, b%a

        m, n = x-u*q, y-v*q

        b,a, x,y, u,v = a,r, u,v, m,n

        g = b

    return x, y, g





def modinv(a, m):

    x, y, g = extgcd(a, m)

    if g != 1:

        print ("[+]Inverse does not exist.")

    else:

        return ((m + x) % m) % m





def mod_comb(n, r, mod):

    ans_mul, ans_div = 1, 1



    for i in range(r):

        ans_mul *= (n-i)

        ans_div *= (i+1)

        ans_mul %= mod

        ans_div %= mod



    return ans_mul * modinv(ans_div, mod) % mod





def main():

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

    v = prime_factorize(M)

    MOD = int(10**9+7)

    ans = 1



    for i in v:

        ans *= mod_comb(N+i[1]-1, i[1], MOD)

        ans %= MOD

    print (ans)



main()

def prime_factor(n):

    ret, p = {}, 2

    while p*p <= n:

        while n % p == 0:

            ret[p] = ret.get(p, 0) + 1

            n //= p

        p += 1

    if n != 1: ret[n] = 1

    return ret





def mod_inverse(x, mod):

    return pow(x, mod-2, mod)





def mod_comb(n, k, mod):

    numer, denom = 1, 1

    for i in range(k):

        numer = numer * ((n-i) % mod) % mod

        denom = denom * ((i+1) % mod) % mod



    return numer * mod_inverse(denom, mod) % mod





def main():

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

    prime = prime_factor(m)

    mod = 1000000007

    ans = 1

    for (p, e) in list(prime.items()):

        ans = ans * mod_comb(n+e-1, e, mod) % mod



    print(ans)



main()
import math


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


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


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


def mod_comb(n, r, mod):
    ans_mul, ans_div = 1, 1
    for i in range(r):
        ans_mul *= n - i
        ans_div *= i + 1
        ans_mul %= mod
        ans_div %= mod
    return ans_mul * modinv(ans_div, mod) % mod


def main():
    N, M = list(map(int, input().split()))
    v = prime_factorize(M)
    MOD = int(10**9 + 7)
    ans = 1
    for i in v:
        ans *= mod_comb(N + i[1] - 1, i[1], MOD)
        ans %= MOD
    print(ans)


main()

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


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


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


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


main()

-import math - - -def prime_factorize(n): -    ret = [] -    # 小さい素数から順に試し割りしていく -    for i in range(2, int(math.sqrt(n)) + 1): -        if n % i != 0: -            continue -        e = 0 -        while n % i == 0: -            e += 1 -            n //= i -        ret += [(i, e)] +def prime_factor(n): +    ret, p = {}, 2 +    while p * p <= n: +        while n % p == 0: +            ret[p] = ret.get(p, 0) + 1 +            n //= p +        p += 1 -        ret += [(n, 1)] +        ret[n] = 1 -def extgcd(a, b): -    x, y, u, v = 0, 1, 1, 0 -    while a != 0: -        q, r = b // a, b % a -        m, n = x - u * q, y - v * q -        b, a, x, y, u, v = a, r, u, v, m, n -        g = b -    return x, y, g +def mod_inverse(x, mod): +    return pow(x, mod - 2, mod) -def modinv(a, m): -    x, y, g = extgcd(a, m) -    if g != 1: -        print("[+]Inverse does not exist.") -    else: -        return ((m + x) % m) % m - - -def mod_comb(n, r, mod): -    ans_mul, ans_div = 1, 1 -    for i in range(r): -        ans_mul *= n - i -        ans_div *= i + 1 -        ans_mul %= mod -        ans_div %= mod -    return ans_mul * modinv(ans_div, mod) % mod +def mod_comb(n, k, mod): +    numer, denom = 1, 1 +    for i in range(k): +        numer = numer * ((n - i) % mod) % mod +        denom = denom * ((i + 1) % mod) % mod +    return numer * mod_inverse(denom, mod) % mod -    N, M = list(map(int, input().split())) -    v = prime_factorize(M) -    MOD = int(10**9 + 7) +    n, m = list(map(int, input().split())) +    prime = prime_factor(m) +    mod = 1000000007 -    for i in v: -        ans *= mod_comb(N + i[1] - 1, i[1], MOD) -        ans %= MOD +    for (p, e) in list(prime.items()): +        ans = ans * mod_comb(n + e - 1, e, mod) % mod