var ModUtils = function(mod){
	this.mod = mod;
}
ModUtils.prototype.inv = function(n) {
  function euclidean(a,b){
  	if(a == 1 && b == 0)return {x:1,y:0};
  	var ans = euclidean(b,a%b);
    var x = ans.y;
    var y = ans.x - x * Math.floor(a/b);
    return {x:x,y:y};
  }
  var c = euclidean(this.mod,n).y;
  while(c < 0){c += this.mod}
  return c;
};
ModUtils.prototype.times = function() {
  var initVal = 1;
  var len = arguments.length;
  for(var i = 0; i < len;i++){
  	var elem = arguments[i];
  	initVal *= elem;
    initVal %= this.mod;
  }
  return initVal;
};
ModUtils.prototype.combination = function(n,k){
  k = Math.min(k,n-k);
  return this.times(
  	...Array.from({length:k},(v,k)=>n-k),
  	this.inv(
    	this.times(...Array.from({length:k},(v,k)=>k+1))
    )
  )
}

function Main(input){
	var N = input.split(" ")[0];
	var M = input.split(" ")[1];

	N = ~~N;
  M = ~~M;
	var prime = [2,3];
  
  input = M;
  
  var inputRoot = Math.floor(Math.sqrt(input));
  
  for(var i = prime[prime.length-1] + 1; i <= inputRoot;i++){
  	if(prime.find(a=>i%a==0)===undefined)prime.push(i);
  } 
  
  var primeFact = {};
  
  for(var elem of prime){
  	while(input%elem == 0){
    	input /= elem;
      primeFact[elem] = (primeFact[elem] || 0)+1;
    }
  }
  
  if(input != 1){
  	primeFact[input] = (primeFact[input] || 0)+1;
  }
  
  var mod = 1000000007;
  var mu = new ModUtils(mod);
  
  return mu.times(
    ...Object.keys(primeFact).map(
      key => mu.combination(primeFact[key]+N-1,N-1)
    )
  )
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
100000 1000000000
`);