using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
static bool[] isPrimes = makePrimeList(100000);//i-1が素数かどうか
static string[] input = Console.ReadLine().Split(' ');
static long n = long.Parse(input[0]);
static long m = long.Parse(input[1]);
static long p = 1000000007;
static long[] factorials = new long[200001];//i!(mod p)を先にメモ
static long[] factorialRs = new long[200001];//i!^-1(mod p), pは素数

	static void Main()
	{
		long answer = 1;
    factorials[0] = 1;
		factorialRs[200000] = DivideModFactorial(200000,p);
		for(long i = 1; i <= 200000; i++)
		{
		factorials[i] = (factorials[i-1]*i)%p;//i!(mod p)
		factorialRs[200000-i] = (factorialRs[200001-i]*(200001-i))%p;//逆元も先にメモ
		}

    makePrimeList(100000);
    List<long> factorList = Factoring(m);
    int countMemo = 0;
    for(int i = 0; i < factorList.Count(); i++)
    {
      //Console.WriteLine(i+" "+factorList[i]);
      if(i == 0) countMemo++;
      else if(factorList[i] == factorList[i-1]) countMemo++;
      else
      {
        answer *= factorials[countMemo+(n-1)];
        answer %= p;
        answer *= factorialRs[countMemo];
        answer %= p;
        answer *= factorialRs[n-1];
        answer %= p;
        countMemo = 1;
      }
    }
    
    if(countMemo > 0)
    {
      answer *= factorials[countMemo+(n-1)];
      answer %= p;
      answer *= factorialRs[countMemo];
      answer %= p;
      answer *= factorialRs[n-1];
      answer %= p;
    }

		Console.WriteLine(answer);
	}

  static List<long> Factoring(long originalNum)
  {//makePrimeListによるisPrimesを用いて、引数をO(√n)で素因数分解。リストには同じ数も含む。
  //例えば1は{},12は{2,2,3},17は{17}を返す。
    List<long> answers = new List<long>();
    for(long i = 2; i <= Math.Sqrt(originalNum); i++)
    {
      if(!isPrimes[i-1]) continue;//素数でないとき
      else
      {
        while(originalNum % i == 0)
        {
          originalNum /= i;
          answers.Add(i);
        }
      }
    }
    if(originalNum != 1) answers.Add(originalNum);
    return answers;
  }

  static bool[] makePrimeList(long maxPrime)
  {//「引数1以上」max以下の素数判定を、エラトステネスの篩を用いてO(n)。
    bool[] isPrimes = new bool[maxPrime];//素数リスト
    isPrimes[0] = false;//1は素数でないのでfalse
    for(long i = 1; i < maxPrime; i++) isPrimes[i] = true;//素数と仮定してtrue
    
    for(long i = 2; i <= Math.Sqrt(maxPrime); i++)
    {
      if(isPrimes[i-1])
      {
        for (long j = i*2; j <= maxPrime; j+=i)
        {
          isPrimes[j-1] = false;//素数でないのでfalse
        }
      }
    }

    return isPrimes;
  }

  static long MathPow(long x, long a)//戻り値はx^a。O(loga)
  {
    long num = 2;
    long answer = 1;
    long check = a;
    long memo = x;
  
    while(check > 0)
    {
      if(check % num == num / 2)
      {
        check -= num / 2;
        answer *= memo;
      }
    memo *= memo;
    num *= 2;
    }
    return answer;
  }

  static long DivideMod(long x, long a, long p)//戻り値はx^a(mod p)。O(loga)
  {
    long num = 2;
    long answer = 1;
    long check = a;
    long memo = x%p;
    
    while(check > 0)
    {
      if(check % num == num / 2)
      {
        check -= num / 2;
        answer *= memo;
        answer %= p;
      }
    memo *= memo;
    memo %= p;
    num *= 2;
    }
    return answer;
  }

  static long DivideModReverse(long x, long p)//戻り値はx^-1(mod p), pは素数。O(logp)
  {
    long answer = DivideMod(x, p-2, p);
    return answer;
  }

  static long ModFactorial(long x, long p)//戻り値はx!(mod p)
  {
    long answer = 1;
    for(int i = 2; i <= x; i++)
    {
      answer *= i;
      answer %= p;
    }
    return answer;
  }

  static long DivideModFactorial(long x, long p)//戻り値はx!^-1(mod p), pは素数
  {
    long answer = 1;
    for(long i = x; i >= 2; i--)
    {
      answer *= DivideModReverse(i, p);
      answer %= p;
    }
    return answer;
  }

  static long Comb(long a, long b, long p)//戻り値は組み合わせC(a,b)のmod p
  {
    if(a-b < 0) return 0;//引数a-bが負なら0を返す
    long answer = 1;
    answer *= factorials[a];
    answer %= p;
    answer *= factorialRs[a-b];
    answer %= p;
    answer *= factorialRs[b];
    answer %= p;
    return answer;
  }

  
}

Measured memory_bytes: 16596