#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdint>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <cstdlib>
#include <sstream>
#include <functional>
#include <bitset>

#include <boost/range/irange.hpp>
using boost::irange;

#include <boost/utility/string_ref.hpp>
using string_view = boost::string_ref;

#include <boost/function_output_iterator.hpp>


using namespace std;

template<class T, size_t N, class F>
struct compare_n
{
    F f;
    bool operator() (const T& t1, const T& t2)
    {
        return f(get<N>(t1), get<N>(t2));
    }
};
 
template<size_t N, class T>
auto make_less_n(const T&)
{
    using t = typename T::value_type;
    using less = std::less<typename tuple_element<N, t>::type>;
    return compare_n<t, N, less>();
}

template<class T>
T digit(T x)
{
    return static_cast<T>(floor(log10(x)+1));
}

int64_t ipow(int64_t x, int64_t y)
{
    return static_cast<int64_t>(pow(x, y));
}

struct point_t
{
    int64_t x,y;
};

map<int, int> factorize(int x)
{
    if(x == 1) return map<int, int>();

    const int sqrt_x = (int)sqrt(x) + 1;
    map<int, int> factor;

    {
        div_t d = div(x, 2);
        while(d.rem == 0)
        {
            factor[2]++;
            x = d.quot;
            d = div(x, 2);
        }
    }
    
    for(const auto p : irange(3, sqrt_x, 2))
    {
        div_t d = div(x, p);
        while(d.rem == 0)
        {
            factor[p]++;
            x = d.quot;
            d = div(x, p);
        }
    }

    if(x > 1)
    {
        factor[x] = 1;
    }
    return factor;
}

class modint_t {
public:
    modint_t() = default;
    modint_t(int64_t value):value(value % MOD){}

    bool operator<(const modint_t rhs) const { return value < rhs.value; }
    bool operator<=(const modint_t rhs) const { return value <= rhs.value; }
    bool operator>(const modint_t rhs) const { return value > rhs.value; }
    bool operator>=(const modint_t rhs) const { return value >= rhs.value; }

    modint_t operator+(const modint_t rhs) const { return modint_t(value + rhs.value); }
    modint_t operator+=(const modint_t rhs) { return value = (value + rhs.value) % MOD; }
    modint_t operator-(const modint_t rhs) const { return modint_t(MOD + value - rhs.value); }
    modint_t operator-=(const modint_t rhs) { return value = (MOD + value - rhs.value) % MOD; }

    modint_t operator*(const modint_t rhs) const { return modint_t(value * rhs.value); }
    modint_t operator*=(const modint_t rhs) { return value = value * rhs.value % MOD; }
    modint_t operator/(const modint_t rhs) const { return *this * rhs.invert(); }
    modint_t operator/=(const modint_t rhs) { return *this *= rhs.invert(); }

    modint_t square() const { return *this * *this; }
    modint_t power(int64_t y) const
    {
        if(y == 0) return 1;
        else if(y == 1) return *this;
        else if(y % 2 == 0) return this->power(y/2).square();
        else return *this * this->power(y-1);
    }

    modint_t invert() const
    {
        return power(MOD-2);
    }

    operator int64_t() const
    {
        return value;
    }
private:
    static const int MOD = 1000000007;
    int64_t value = 0;
};

modint_t combination(int64_t n, int64_t r)
{
    if(r * 2 > n) r = n - r;
    modint_t x = 1;
    modint_t y = 1;
    for(int64_t i = 1; i <= r; ++i)
    {
        x *= n - i + 1;
        y *= i;
    }
    return x / y;
}

modint_t multichoose(int64_t n, int64_t k)
{
    return combination(n + k - 1, k);
}

modint_t f(int64_t n, int64_t m)
{
    modint_t count = 1;
    const auto factors = factorize(m);
    for(auto p : factors)
    {
        //cout << p.first << '^' << p.second << '\n';
        count *= multichoose(n, p.second);
    }
    return count;
}

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

    int n, m;
    cin >> n >> m;
    
    cout << f(n, m) << '\n';
    
    return 0;
}



Measured memory_bytes: 256