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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC_D
{
    class D110
    {
        static int _Mod = 1000000007;

        static void Main(string[] args)
        {
            int[] a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int N = a[0], M = a[1];

            List<int> listPN = GetPrimeNumbers((int)Math.Sqrt(M) + 100);
            Dictionary<int, int> dic = GetPrimeFactorsAsDic(M, listPN);

            long count = 1;

            foreach (var v in dic)
            {
                long c = Combination(v.Value + N - 1, v.Value);
                count = (count * c) % _Mod;
            }

            Console.WriteLine(count);
        }

        //xまでの素数を列挙O(n^1.5)
        public static List<int> GetPrimeNumbers(int x)
        {
            long sn = (long)System.Math.Sqrt(x);
            List<int> list = new List<int>();
            for (int number = 2; number <= x; number++)
            {
                int i = 0;
                while (true)
                {
                    if (i >= list.Count || list[i] > sn)
                    {
                        list.Add(number);
                        break;
                    }
                    if (number % list[i] == 0) break;
                    i++;
                }
            }
            return list;
        }


        public static Dictionary<int, int> GetPrimeFactorsAsDic(int x, List<int> primeNumbers = null)
        {
            Dictionary<int, int> dic = new Dictionary<int, int>();
            if (primeNumbers == null) primeNumbers = GetPrimeNumbers(x);

            int k = 0;
            while (true)
            {
                bool can_div = false;
                for (int i = k; i < primeNumbers.Count; i++)
                {
                    int n = primeNumbers[i];
                    if (x % n == 0)
                    {
                        if (!dic.ContainsKey(n)) dic.Add(n, 1);
                        else dic[n]++;
                        x /= primeNumbers[i];
                        k = i;
                        can_div = true;
                        break;
                    }
                }
                if (!can_div) break;
            }
            return dic;
        }



        //階乗n!(mod p)のベクトル
        public static List<long> Factorial(int n)
        {
            long x = 1;
            List<long> list = new List<long>();
            list.Add(x);
            for (int i = 1; i <= n; i++)
            {
                x = (x * i) % _Mod;
                list.Add(x);
            }
            return list;
        }

        //累乗(a^n) O(logn)
        public static long ModPow(long a, int n)
        {
            long res = 1;
            while (n > 0)
            {
                if (n % 2 == 1) res = (res * a) % _Mod;
                a = (a * a) % _Mod;
                n >>= 1;
            }
            return res;
        }

        //逆元1/n(mod p) (1<=n<p)
        public static long InverseElement(long n)
        {
            return ModPow(n, _Mod - 2);
        }


        //階乗の逆元 1/n! (mod p)のベクトル
        public static List<long> InversePower(int n)
        {
            long x = 1;
            List<long> list = new List<long>();
            list.Add(x);
            for (int i = 1; i <= n; i++)
            {
                x = (x * InverseElement(i)) % _Mod;
                list.Add(x);
            }
            return list;
        }

        //組み合わせの数nCr (mod p)
        public static long Combination(int n, int r)
        {
            List<long> power = Factorial(n);
            List<long> inv = InversePower(n);
            long denominator = (inv[r] * inv[n - r]) % _Mod;
            long val = (power[n] * denominator) % _Mod;
            return val;
        }


    }
}