function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0].split(" ")[0]);
  var m = parseInt(input[0].split(" ")[1]);
  x=primeFactorization(m);
  var mod=Math.pow(10,9)+7;
  var ans=1;
  var perm1=1;
  var perm2=1;
  for(i=0;i<x.length;i++){
    perm1=(perm1*permutation(x[i]+n-1,n-1))%mod;
    perm2=(perm2*permutation(n-1,n-1))%mod;
  }
  for(i=0;i<mod;i++){
    if((perm2*i)%mod==1){
      perm2=i;
      break;
    }
  }
  ans=(perm1*perm2)%mod;
  function permutation(n, r) {
    for(var i = 0, res = 1; i < r; i++) {
      res = res*( n - i )%mod;
    }
    return res;
  }
    
  function combination(n, r) {
    return permutation(n, r) / permutation(r, r);
  }

  function primeFactorization(n) {
    var s = Math.floor(Math.sqrt(n));
    var r = 0;
    var result = Array();
    for (var i = 2;i <= s;i++) {
      if ((n % i) == 0) {
        r = 0;
        do {
          r++;
          n = n / i;
        } while ((n % i) == 0);
        result.push(r);
      }
    }
    if (n > s) {
      result.push(1);
    }
    return result;
  }

  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));