Problem:
Score : 400 points

Problem Statement

You are given positive integers N and M.

How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7.

Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.

Constraints

All values in input are integers.

1 \leq N \leq 10^5

1 \leq M \leq 10^9

Input

Input is given from Standard Input in the following format:

N M

Output

Print the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.

Sample Input 1

2 6

Sample Output 1

4

Four sequences satisfy the condition: \{a_1, a_2\} = \{1, 6\}, \{2, 3\}, \{3, 2\} and \{6, 1\}.

Sample Input 2

3 12

Sample Output 2

18

Sample Input 3

100000 1000000000

Sample Output 3

957870001

Solution in JavaScript (node.js v5.12) (judge verdict: Wrong Answer)

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;
}