//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

using i8 = ::std::int_least8_t;
using i32 = ::std::int_least32_t;
using i64 = ::std::int_least64_t;
using u8 = ::std::uint_least8_t;
using u32 = ::std::uint_least32_t;
using u64 = ::std::uint_least64_t;
using isize = ::std::ptrdiff_t;
using usize = ::std::size_t;

class rep {
	const usize f, l;

public:
	class itr {
		friend rep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { ++i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	rep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(f); }
	itr end() const noexcept { return itr(l); }
};
class revrep {
	const usize f, l;

public:
	class itr {
		friend revrep;
		usize i;
		itr(usize x) noexcept : i(x) {}

	public:
		void operator++() noexcept { --i; }
		usize operator*() const noexcept { return i; }
		bool operator!=(const itr x) const noexcept { return i != x.i; }
	};
	revrep(usize first, usize last) noexcept : f(first), l(last) {}
	itr begin() const noexcept { return itr(l - 1); }
	itr end() const noexcept { return itr(f - 1); }
};
template <class T> bool maxi(T &a, const T &b) {
	return a <= b ? (a = b, 1) : 0;
}
template <class T> bool mini(T &a, const T &b) {
	return b <= a ? (a = b, 1) : 0;
}
template <class T> bool smaxi(T &a, const T &b) {
	return b <= a ? 0 : (a = b, 1);
}
template <class T> bool smini(T &a, const T &b) {
	return a <= b ? 0 : (a = b, 1);
}
template <class T> using vec_alias = ::std::vector<T>;
template <class T> auto md_vec(usize n, const T &value) {
	return ::std::vector<T>(n, value);
}
template <class... Args> auto md_vec(usize n, Args... args) {
	return ::std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> const T &as_const(const T &v) noexcept { return v; }

#include <cstdint>

template <::std::uint_fast32_t MODULO> class modint {
	using uint32 = ::std::uint_fast32_t;
	using uint64 = ::std::uint_fast64_t;

public:
	using value_type = uint32;
	uint32 a;
	modint() noexcept : a(0) {}
	modint(const uint32 x) noexcept : a(x) {}
	uint32 value() const noexcept { return a; }
	modint operator+(const modint &o) const noexcept {
		return a + o.a < MODULO ? modint(a + o.a) : modint(a + o.a - MODULO);
	}
	modint operator-(const modint &o) const noexcept {
		return modint(a < o.a ? a + MODULO - o.a : a - o.a);
	}
	modint operator*(const modint &o) const noexcept {
		return modint(static_cast<uint64>(a) * o.a % MODULO);
	}
	modint operator/(const modint &o) const {
		return modint(static_cast<uint64>(a) * (~o).a % MODULO);
	}
	modint &operator+=(const modint &o) noexcept { return *this = *this + o; }
	modint &operator-=(const modint &o) noexcept { return *this = *this - o; }
	modint &operator*=(const modint &o) noexcept { return *this = *this * o; }
	modint &operator/=(const modint &o) { return *this = *this / o; }
	modint operator~() const noexcept { return pow(MODULO - 2); }
	modint operator-() const noexcept { return a ? modint(MODULO - a) : *this; }
	modint operator++() noexcept { return a == MODULO - 1 ? a = 0 : ++a, *this; }
	modint operator--() noexcept { return a ? --a : a = MODULO - 1, *this; }
	bool operator==(const modint &o) const noexcept { return a == o.a; }
	bool operator!=(const modint &o) const noexcept { return a != o.a; }
	bool operator<(const modint &o) const noexcept { return a < o.a; }
	bool operator<=(const modint &o) const noexcept { return a <= o.a; }
	bool operator>(const modint &o) const noexcept { return a > o.a; }
	bool operator>=(const modint &o) const noexcept { return a >= o.a; }
	explicit operator bool() const noexcept { return a; }
	explicit operator uint32() const noexcept { return a; }
	modint pow(uint32 x) const noexcept {
		uint64 t = a, u = 1;
		while (x) {
			if (x & 1)
				u = u * t % MODULO;
			t = (t * t) % MODULO;
			x >>= 1;
		}
		return modint(u);
	}
};


#include <algorithm>
#include <iostream>
#include <utility>
#include <array>
#include <string>

int main() {
	static constexpr u32 MOD = 1000000007;
	using mint = modint<MOD>;
	usize n;
	u32 m;
	::std::cin >> n >> m;
	::std::vector<usize> a;
	u32 pred = 0;
	while (m != 1) {
		for (const auto i : rep(2, m + 1)) {
			if (!(m%i)) {
				if (pred != i)
					a.emplace_back(0);
				++a.back();
				pred = i;
				m /= i;
				break;
			}
		}
	}
	::std::vector<mint> fact(n + 32);
	fact[0] = 1;
	for (const auto i : rep(1, n + 32))
		fact[i] = fact[i - 1] * i;
	mint ans = 1;
	for (const auto e : a)
		ans *= fact[n + e - 1] / fact[n - 1] / fact[e];
	::std::cout << ans.a << ::std::endl;
	return 0;
}


Measured memory_bytes: 1024