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: Runtime Error)

using System;

namespace debug
{
    class Program
    {
        static void Main(string[] args)
        {
            ProgramD a = new ProgramD();
            a.main();

        }
    }

    //ABC110
    class ProgramA
    {
        public void main()
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();

            if (s1[0] == s2[2] && s1[1] == s2[1] && s1[2] == s2[0])
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
        }
    }

    class ProgramB
    {
        public void main()
        {
            long n = long.Parse(Console.ReadLine());
            for (long i = 1; i < 100000; i++)
            {
                if (i * i > n)
                {
                    Console.WriteLine((i - 1) * (i - 1));
                    return;
                }

            }
        }
    }

    class ProgramC
    {
        public void main()
        {
            int n = int.Parse(Console.ReadLine());
            long[] a = new long[n];
            long[] b = new long[n];
            long[] c = new long[n];

            string[] s1 = Console.ReadLine().Split(' ');
            string[] s2 = Console.ReadLine().Split(' ');
            string[] s3 = Console.ReadLine().Split(' ');

            for (int i = 0; i < n; i++)
            {
                a[i] = long.Parse(s1[i]);
                b[i] = long.Parse(s2[i]);
                c[i] = long.Parse(s3[i]);
            }

            if (n == 1)
            {
                if (a[0] < b[0] && b[0] < c[0])
                    Console.WriteLine(1);
                else
                    Console.WriteLine(0);
                return;
            }

            //ソートする
            Array.Sort(a);
            Array.Sort(b);
            Array.Sort(c);
            long ans = 0;

            for (int i = 0; i < n; i++)
            {
                //aの二分探索(bより小さいものを探す）
                long ans1 = 0;

                //検索範囲をこうしないとmax = 0からnとn種類の答えが取れない
                long min = -1;
                long max = n;
                
                while(min + 1 != max)
                {
                    long temp = (max + min) / 2;
                    if (a[temp] < b[i])
                        min = temp;
                    else
                        max = temp;
                }

                ans1 = min + 1;

                //cの二分探索（bより大きいものを探す）
                long ans2 = 0;
                //検索範囲をこうしないとmax = 0からnとn種類の答えが取れない
                min = -1;
                max = n;

                while (min + 1 != max) 
                {
                    long temp = (max + min) / 2;
                    if (c[temp] > b[i])
                        max = temp;
                    else
                        min = temp;

                }
                    
                ans2 = n - max;
                
                //答えを足す
                ans += ans1 * ans2;

            }

            Console.WriteLine(ans);
        }
    }


    //ACしてないです。
    class ProgramD
    {
        public void main()
        {
            string[] s = Console.ReadLine().Split(' ');
            long n = long.Parse(s[0]); 
            long m = long.Parse(s[1]);
            long t = m;
            long count = 0;
            long[] fac = new long[n + 1];
            for(long i = 2;i <= Math.Sqrt(m);i++)
            {
                if(m % i == 0)
                {
                    while (t % i == 0)
                    {
                        t /= i;
                        fac[count]++;
                    }
                    count++;
                }

            }

            if(t != 1)
            {
                fac[count]++;
                count++;
            }

            long MOD = 1000000000 + 7;
            long sum = 1;

            //下準備
            nCk com = new nCk();
            com.fac = new long[n + 50];
            com.inv = new long[n + 50];
            com.finv = new long[n + 50];
            com.mod = MOD;
            com.max = n + 50;

            //メモ作成
            com.com_init();

            for (int i = 0;i < count;i++)
            {
                sum *= com.com(n + fac[i] - 1, fac[i]);
                sum %= MOD;
            }

            Console.WriteLine(sum);
        }

    }

    class nCk
    {
        public long mod;
        public long max;
        public long[] fac;
        public long[] inv;
        public long[] finv;


        //メモ作成(前準備)
        public void com_init()
        {
            fac[0] = 1;
            fac[1] = 1;
            finv[0] = 1;
            finv[1] = 1;
            inv[1] = 1;
            for (long i = 2; i < max; i++)
            {
                fac[i] = i * fac[i - 1] % mod;
                inv[i] = mod - inv[mod % i] * (mod / i) % mod;
                finv[i] = finv[i - 1] * inv[i] % mod;
            }
        }

        //二項計算
        public long com(long n, long k)
        {
            if (n < 0 || k < 0)
                return 0;
            if (n < k)
                return 0;
            return fac[n] * (finv[n - k] * finv[k] % mod) % mod;
        }

    }


}