def nCr(n,r):

    a=1

    x=n

    while(x!=n-r):

      a*=x

      x-=1

    b=1

    x=r

    while(x!=0):

      b*=x

      x-=1

    return a//b



INF=10**9+7

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





sum=1

yd = {}

i = 2

while m != 1:

  while m % i == 0:

    if i in yd:

      yd[i] += 1

    else:

      yd[i] = 1

    m //= i

  i += 1

for b in list(yd.values()):

    if b<N-1:

        sum*=nCr(N-1+b,b)

    else:

        sum*=nCr(N-1+b,N-1)

    sum%=INF  

print(sum)

def main():

    def nCr(n,r):

        a=1

        x=n

        while(x!=n-r):

          a*=x

          x-=1

        b=1

        x=r

        while(x!=0):

          b*=x

          x-=1

        return a//b



    INF=10**9+7

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





    sum=1

    yd = {}

    i = 2

    while m != 1:

      while m % i == 0:

        if i in yd:

          yd[i] += 1

        else:

          yd[i] = 1

        m //= i

      i += 1

    for b in list(yd.values()):

        if b<N-1:

            sum*=nCr(N-1+b,b)

        else:

            sum*=nCr(N-1+b,N-1)

        sum%=INF  

    print(sum)

if __name__ == '__main__':

    main()

def nCr(n, r):
    a = 1
    x = n
    while x != n - r:
        a *= x
        x -= 1
    b = 1
    x = r
    while x != 0:
        b *= x
        x -= 1
    return a // b


INF = 10**9 + 7
N, m = list(map(int, input().split()))
sum = 1
yd = {}
i = 2
while m != 1:
    while m % i == 0:
        if i in yd:
            yd[i] += 1
        else:
            yd[i] = 1
        m //= i
    i += 1
for b in list(yd.values()):
    if b < N - 1:
        sum *= nCr(N - 1 + b, b)
    else:
        sum *= nCr(N - 1 + b, N - 1)
    sum %= INF
print(sum)

def main():
    def nCr(n, r):
        a = 1
        x = n
        while x != n - r:
            a *= x
            x -= 1
        b = 1
        x = r
        while x != 0:
            b *= x
            x -= 1
        return a // b

    INF = 10**9 + 7
    N, m = list(map(int, input().split()))
    sum = 1
    yd = {}
    i = 2
    while m != 1:
        while m % i == 0:
            if i in yd:
                yd[i] += 1
            else:
                yd[i] = 1
            m //= i
        i += 1
    for b in list(yd.values()):
        if b < N - 1:
            sum *= nCr(N - 1 + b, b)
        else:
            sum *= nCr(N - 1 + b, N - 1)
        sum %= INF
    print(sum)


if __name__ == "__main__":
    main()

-def nCr(n, r): -    a = 1 -    x = n -    while x != n - r: -        a *= x -        x -= 1 -    b = 1 -    x = r -    while x != 0: -        b *= x -        x -= 1 -    return a // b +def main(): +    def nCr(n, r): +        a = 1 +        x = n +        while x != n - r: +            a *= x +            x -= 1 +        b = 1 +        x = r +        while x != 0: +            b *= x +            x -= 1 +        return a // b + +    INF = 10**9 + 7 +    N, m = list(map(int, input().split())) +    sum = 1 +    yd = {} +    i = 2 +    while m != 1: +        while m % i == 0: +            if i in yd: +                yd[i] += 1 +            else: +                yd[i] = 1 +            m //= i +        i += 1 +    for b in list(yd.values()): +        if b < N - 1: +            sum *= nCr(N - 1 + b, b) +        else: +            sum *= nCr(N - 1 + b, N - 1) +        sum %= INF +    print(sum) -INF = 10**9 + 7 -N, m = list(map(int, input().split())) -sum = 1 -yd = {} -i = 2 -while m != 1: -    while m % i == 0: -        if i in yd: -            yd[i] += 1 -        else: -            yd[i] = 1 -        m //= i -    i += 1 -for b in list(yd.values()): -    if b < N - 1: -        sum *= nCr(N - 1 + b, b) -    else: -        sum *= nCr(N - 1 + b, N - 1) -    sum %= INF -print(sum) +if __name__ == "__main__": +    main()