from math import sqrt, ceil, factorial

from collections import defaultdict





def prime_factors(n):

    i = 2

    factors = defaultdict(int)

    while i * i <= n:

        if n % i:

            i += 1

        else:

            n //= i

            factors[i] += 1

    if n > 1:

        factors[n] += 1

    return factors





N, M = [int(elem) for elem in input().split(' ')]



# 素因数分解

prime_numbers = prime_factors(M)

sum = 1

fac_N_m1 = factorial(N - 1)



for value in list(prime_numbers.values()):

    bunshi = 1

    saisho = value + N - 1

    for _ in range(value):

        bunshi *= saisho

        saisho -= 1

    sum *= (bunshi // factorial(value))

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

from collections import defaultdict





def prime_factorize(num):

    prime_numbers = defaultdict(int)

    i = 2

    while i * i <= num:

        if num % i == 0:

            while num % i == 0:

                prime_numbers[i] += 1

                num //= i

        i += 1

    if num != 1:

        prime_numbers[num] += 1

    return prime_numbers





MOD = 10**9 + 7

N, M = [int(elem) for elem in input().split()]



prime_numbers = prime_factorize(M)



num_sequences = 1

for exponent in list(prime_numbers.values()):

    denomimator = 1

    numerator = 1

    for i in range(1, exponent + 1):

        denomimator *= (N + exponent - i)

        numerator *= i

    num_sequences *= denomimator // numerator

    num_sequences %= MOD



print(num_sequences)

from math import sqrt, ceil, factorial
from collections import defaultdict


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


N, M = [int(elem) for elem in input().split(" ")]
# 素因数分解
prime_numbers = prime_factors(M)
sum = 1
fac_N_m1 = factorial(N - 1)
for value in list(prime_numbers.values()):
    bunshi = 1
    saisho = value + N - 1
    for _ in range(value):
        bunshi *= saisho
        saisho -= 1
    sum *= bunshi // factorial(value)
print((sum % (10**9 + 7)))

from collections import defaultdict


def prime_factorize(num):
    prime_numbers = defaultdict(int)
    i = 2
    while i * i <= num:
        if num % i == 0:
            while num % i == 0:
                prime_numbers[i] += 1
                num //= i
        i += 1
    if num != 1:
        prime_numbers[num] += 1
    return prime_numbers


MOD = 10**9 + 7
N, M = [int(elem) for elem in input().split()]
prime_numbers = prime_factorize(M)
num_sequences = 1
for exponent in list(prime_numbers.values()):
    denomimator = 1
    numerator = 1
    for i in range(1, exponent + 1):
        denomimator *= N + exponent - i
        numerator *= i
    num_sequences *= denomimator // numerator
    num_sequences %= MOD
print(num_sequences)

-from math import sqrt, ceil, factorial -def prime_factors(n): +def prime_factorize(num): +    prime_numbers = defaultdict(int) -    factors = defaultdict(int) -    while i * i <= n: -        if n % i: -            i += 1 -        else: -            n //= i -            factors[i] += 1 -    if n > 1: -        factors[n] += 1 -    return factors +    while i * i <= num: +        if num % i == 0: +            while num % i == 0: +                prime_numbers[i] += 1 +                num //= i +        i += 1 +    if num != 1: +        prime_numbers[num] += 1 +    return prime_numbers -N, M = [int(elem) for elem in input().split(" ")] -# 素因数分解 -prime_numbers = prime_factors(M) -sum = 1 -fac_N_m1 = factorial(N - 1) -for value in list(prime_numbers.values()): -    bunshi = 1 -    saisho = value + N - 1 -    for _ in range(value): -        bunshi *= saisho -        saisho -= 1 -    sum *= bunshi // factorial(value) -print((sum % (10**9 + 7))) +MOD = 10**9 + 7 +N, M = [int(elem) for elem in input().split()] +prime_numbers = prime_factorize(M) +num_sequences = 1 +for exponent in list(prime_numbers.values()): +    denomimator = 1 +    numerator = 1 +    for i in range(1, exponent + 1): +        denomimator *= N + exponent - i +        numerator *= i +    num_sequences *= denomimator // numerator +    num_sequences %= MOD +print(num_sequences)