//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

// constant value
#define MOD 1000000007LL

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

// Computational Complexity: O(log(max(a, b))) 
template<class Integer>
inline Integer getGCD(Integer a, Integer b)
{
	if (b == 0)
	{
		return a;
	}
	return getGCD(b, a % b);
}

// Computational Complexity: O(log(max(a, b))) 
template<class Integer>
inline pair<Integer, Integer> getBezoutsIdentitySoulution(Integer a, Integer b)
{
	if (b == 0)
	{
		return { 1, 0 };
	}
	auto sol = getBezoutsIdentitySoulution(b, a % b);
	return { sol.second, sol.first - (a / b) * sol.second };
}

// Computational Complexity: O(log(max(a, n))) 
template<class Integer>
inline Integer getModInverse(Integer a, Integer n)
{
	auto sol = getBezoutsIdentitySoulution(a, n);
	if (a * sol.first + n * sol.second != 1)
	{
		return -1;
	}
	return (sol.first >= 0 ? sol.first : sol.first + n);
}

template<class Integer>
inline Integer getCeilExponent(Integer a)
{
    if (a <= 0)
    {
        return 0;
    }

    Integer index = 0;
    --a;
    for( ; a != 0; a >>= 1 )
    {
        ++index;
    }
    return index;
}

template<class Integer>
inline Integer getFloorExponent(Integer a)
{
    if (a <= 0)
    {
        return 0;
    }

    Integer index = 0;
    a >>= 1;
    for( ; a != 0; a >>= 1 )
    {
        ++index;
    }
    return index;
}

class UnionFindTree
{
private:
    const unsigned elemCount_;
    vector<unsigned> parentNodeNumbers_;
    vector<unsigned> treeDepths_;
    
	// Average Computational Complexity: O(log(elemCount_))) 
	unsigned getRootNode(unsigned x)
    {
        if (parentNodeNumbers_[x] == x)
        {
            return x;
        }
        else
        {
            return getRootNode(parentNodeNumbers_[x]);
        }
    }

public:
    UnionFindTree(unsigned elemCount) : elemCount_(elemCount), parentNodeNumbers_(elemCount), treeDepths_(elemCount, 0)
    {
        for (unsigned i = 0; i < parentNodeNumbers_.size(); ++i) 
        {
            parentNodeNumbers_[i] = i;
        }
    }

	// Average Computational Complexity: O(log(elemCount_))) 
	void uniteSet(unsigned x, unsigned y)
    {
        x = getRootNode(x);
        y = getRootNode(y);
        if ( x == y )
        {
            return;
        }
        
        if (treeDepths_[x] < treeDepths_[y])
        {
            parentNodeNumbers_[x] = y;
        }
        else
        {
            parentNodeNumbers_[y] = x;
            if (treeDepths_[x] == treeDepths_[y])
            {
                ++treeDepths_[x];
            }
        }
    }

	// Average Computational Complexity: O(log(elemCount_))) 
	bool includedInSameSet(unsigned x, unsigned y)
    {
        return getRootNode(x) == getRootNode(y);
    }
};

struct CalcComb
{
	map<int, int> primeToCount;
	CalcComb(int m)
	{
		int rootM = sqrt(m);
		vector<bool> isCompositeNumber(rootM + 1, false);

		for (int p = 2; m != 1 && p <= rootM ; ++p)
		{
			if (!isCompositeNumber[p])
			{
				for (int i = p * 2; i <= rootM; i += p)
				{
					isCompositeNumber[i] = true;
				}

				int count = 0;
				while (m % p == 0)
				{
					++count;
					m /= p;
				}
				if ( count >= 1)
				{
					primeToCount.insert(make_pair(p, count));
				}
			}
		}
		if (m != 1)
		{
			primeToCount.insert(make_pair(m, 1));
		}
	};

	long long comb(long long num, long long n)
	{
		long long res = 1;
		for (; n > 0; --num, --n)
		{
			res = (((res * num) % MOD) * getModInverse(n, MOD)) % MOD;
		}
		return (res >= 0 ? res : res + MOD);
	}

	long long calc(int n)
	{
		long long res = 1;
		for (auto iter = primeToCount.begin(); iter != primeToCount.end(); ++iter)
		{
			auto num = iter->second;;
			res = (res * comb(num + n - 1, num)) % MOD;
		}
		return (res >= 0 ? res : res + MOD);
	}
};

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	long long n, m;
	cin >> n >> m;

	auto a = CalcComb(m);
	cout << a.calc(n);
}




Measured memory_bytes: 256