#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"import math\n"
"import random\n"
"class Prime:\n"
"    seed_primes=[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]\n"
"    def is_prime(self,n):\n"
"        is_prime_common=self.is_prime_common(n)\n"
"        if is_prime_common is not None:return is_prime_common\n"
"        if n<2000000:return self.is_prime_brute_force(n)\n"
"        return self.is_prime_miller_rabin(n)\n"
"    def is_prime_common(self,n):\n"
"        if n==1:return False\n"
"        if n in Prime.seed_primes:return True\n"
"        if any(map(lambda x:n%x==0,self.seed_primes)):return False\n"
"    def is_prime_brute_force(self,n):\n"
"        for k in range(2,int(math.sqrt(n))+1):\n"
"            if n%k==0:return False\n"
"        return True\n"
"    def is_prime_miller_rabin(self,n):\n"
"        d=n-1\n"
"        while d&1==0:d>>=1\n"
"        witnesses=self.get_witnesses(n)\n"
"        for w in witnesses:\n"
"            y=pow(w,d,n)\n"
"            while d!=n-1and y!=1and y!=n-1:\n"
"                y=y*y%n\n"
"                d<<=1\n"
"            if y!=n-1and d&1==0:return False\n"
"        return True\n"
"    def get_witnesses(self,num):\n"
"        def _get_range(num):\n"
"            if num<2047:return 1\n"
"            if num<1373653:return 2\n"
"            if num<25326001:return 3\n"
"            if num<3215031751:return 4\n"
"            if num<2152302898747:return 5\n"
"            if num<3474749660383:return 6\n"
"            if num<341550071728321:return 7\n"
"            if num<3825123056546413051:return 9\n"
"            return 12\n"
"        return self.seed_primes[:_get_range(num)]\n"
"    def gcd(self,a,b):\n"
"        if a<b:return self.gcd(b,a)\n"
"        if b==0:return a\n"
"        while b:a,b=b,a%b\n"
"        return a\n"
"    @staticmethod\n"
"    def f(x,n,seed):\n"
"        p=Prime.seed_primes[seed%len(Prime.seed_primes)]\n"
"        return(p*x+seed)%n\n"
"    def find_factor(self,n,seed=1):\n"
"        if self.is_prime(n):return n\n"
"        x,y,d=2,2,1\n"
"        count=0\n"
"        while d==1:\n"
"            count+=1\n"
"            x=self.f(x,n,seed)\n"
"            y=self.f(self.f(y,n,seed),n,seed)\n"
"            d=self.gcd(abs(x-y),n)\n"
"        if d==n:\n"
"            return self.find_factor(n,seed+1)\n"
"        return self.find_factor(d)\n"
"    # nのすべての素因数を見つける\n"
"    def find_factors(self,n):\n"
"        primes={}\n"
"        if self.is_prime(n):\n"
"            primes[n]=1\n"
"            return primes\n"
"        while n>1:\n"
"            factor=self.find_factor(n)\n"
"            primes.setdefault(factor,0)\n"
"            primes[factor]+=1\n"
"            n//=factor\n"
"        return primes\n"
"class Factorial:\n"
"    def __init__(self,n,mod):\n"
"        self.f=[1]\n"
"        for i in range(1,n+1):\n"
"            self.f.append(self.f[-1]*i%mod)\n"
"        self.i=[pow(self.f[-1],mod-2,mod)]\n"
"        for i in range(1,n+1)[::-1]:\n"
"            self.i.append(self.i[-1]*i%mod)\n"
"        self.i.reverse()\n"
"    def factorial(self,i):\n"
"        return self.f[i]\n"
"    def ifactorial(self,i):\n"
"        return self.i[i]\n"
"    def comb(self,n,k):\n"
"        return self.f[n]*self.i[n-k]%mod*self.i[k]%mod\n"
"mod=10**9+7\n"
"n,m=map(int,input().split())\n"
"*d,=Prime().find_factors(m).values()\n"
"if d:f=Factorial(n+max(d),mod)\n"
"ans=1\n"
"for t in d:\n"
"    ans=ans*f.comb(n-1+t,t)%mod\n"
"print(ans)\n"
"\"";
  system(s);
  return 0;
}            

Measured memory_bytes: 11804