function gets(str){
  this._s = str.split("\n");
  this._y = 0;
};
gets.prototype = {
  a: function(f){
    var s = this._s, y = this._y, r;
    if(typeof s[y] === "string")s[y] = s[y].split(" ").reverse();
    r = s[y].pop();
    if(!s[y].length)this._y++;
    return f?r:+r;
  },
  l: function(f){
    var s = this._s[this._y++].split(" ");
    return f?s:s.map(a=>+a);
  },
  m: function(n,f){
    var s = this._s, y = this._y, r = [], i = 0;
    if(f)for(;i < n; i++)r[i] = s[y+i].split(" ");
    else for(;i < n; i++)r[i] = s[y+i].split(" ").map(a=>+a);
    this._y += n;
    return r;
  },
};
var o=new gets(require("fs").readFileSync("/dev/stdin","utf8"));
var mod = 1e9 + 7;
var fact=[1,1];
function factmod(n){for(var i=fact.length;i<=n;)fact[i]=abmod(fact[i-1],i++);return fact[n];}
function modinv(a){var b=mod,u=1,v=0,t;while(b){t=a/b|0;a-=t*b;u-=t*v;t=a;a=b;b=t;t=u;u=v;v=t;}u%=mod;return u<0?u+mod:u;}
function nCrmod(n,r){return abmod(factmod(n),modinv(factmod(r)),modinv(factmod(n-r)));}
function abmod(){var a=arguments,r=a[0],i=1;for(;i<a.length;)r=((r>>16)*a[i]%mod*65536+(r&65535)*a[i++])%mod;return r;}

console.log(main());
function main(){
  var n = o.a();
  var m = o.a();
  if(m === 1)return 1;
  var a = {};
  while(m % 2 === 0){
    if(a[2])a[2]++;
    else a[2] = 1;
    m /= 2;
  }
  for(var i = 3; i <= Math.sqrt(m); i += 2){
    while(m % i === 0){
      if(a[i])a[i]++;
      else a[i] = 1;
      m /= i;
    }
  }
  if(m !== 1) a[m] = 1;
  var ans = 1;
  for(i in a){
    ans = abmod(ans, nCrmod(a[i] + n - 1, a[i]));
  }
  return ans;
}