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 C# (Mono 4.6.2.0) (judge verdict: Wrong Answer)

using System;
using System.Linq;
public class Program{
    public static void Main(){
        string[] input = Console.ReadLine().Split(' ');
        int n = int.Parse(input[0]);
        int x = int.Parse(input[1]);
        int[] prime = {2};
        for(int i=3;i*(i-1)<=x;i++){
            int p_l = prime.Length;
            int count = 0;
            for(int j=0;j<p_l;j++){
                if(i%prime[j]==0){
                    count++;
                    j=p_l;
                }
            }
            if(count == 0){
                prime = prime.Concat(new int[]{i}).ToArray();
            }
        }
        int yakusukosu = 0;
        int[] waretakaisu = new int[prime.Length];
        while(x > 1){
            for(int i=0;i<prime.Length;i++){
                if(x%prime[i] == 0){
                    yakusukosu++;
                    x /= prime[i];
                    waretakaisu[i]++;
                }
            }
        }
        long ans = 1;
        for(int i=0;i<waretakaisu.Length;i++){
            if(waretakaisu[i] == 1){
                ans *= n;
            }else if(waretakaisu[i] > 1){
                int nn = n + waretakaisu[i] -1;
                int rr = waretakaisu[i];
                int ue = 1;
                int sita = 1;
                for(int j=rr;j>0;j--){
                    ue *= nn;
                    sita *= rr;
                    nn--;
                    rr--;
                }
                ans *= ue/sita;
            }
            if(ans>=1000000007){
                ans = ans%1000000007;
            }
        }
        Console.WriteLine(ans);
    }
}