#include <bits/stdc++.h>

#define REP(i, n) for(decltype(n) i = 0; i < n; i++)

#define ALL(c)   c.begin(), c.end()
#define SORT(c)  std::sort(ALL(c))
#define RSORT(c) std::sort(ALL(c), std::greater<decltype(c)::value_type>())

using namespace std;
using ll = long long;

const int MOD  = (int)1e9 + 7;
const int INF  = (int)1e9 + 1;
const ll  LINF = (long long)1e18 + 1;

class PrimeNumberCalculator {
    using ull = unsigned long long;
public:
    PrimeNumberCalculator(const ull& n_max) :
        list_(generateList(std::sqrt(n_max))) { }

    const std::vector<ull>& getList() const {
        return list_;
    }

    bool check(const ull& n) const {
        ull n_max = std::sqrt(n);
        for(const auto& v : list_) {
            if(n_max < v) {
                break;
            }
            else if(n % v == 0) {
                return false;
            }
        }
        return true;
    }

    std::map<ull, ull> generatePrimeFactorizationMap(ull n) const {
        std::map<ull, ull> prime_cnt_map;
        ull n_max = std::sqrt(n);
        for(const auto& v : list_) {
            if(n_max < v) {
                break;
            }
            while(n % v == 0) {
                n /= v;
                auto itr = prime_cnt_map.find(v);
                if(itr != prime_cnt_map.end()) {
                    itr->second++;
                }
                else {
                    prime_cnt_map.insert(make_pair(v, 1));
                }
            }
        }
        if(1 < n) {
            prime_cnt_map.insert(make_pair(n, 1));
        }
        return prime_cnt_map;
    }

    ull calcNumOfDivisor(ull n) const {
        ull  num = 1;
        auto map = generatePrimeFactorizationMap(n);
        for(const auto& v : map) {
            num *= (v.second + 1);
        }
        return num;
    }

    ull calcSumOfDivisor(ull n) const {
        ull sum   = 1;
        auto map = generatePrimeFactorizationMap(n);
        for(const auto& v : map) {
            ull t     = 1;
            ull t_sum = 1;
            for(ull i = 0; i < v.second; i++) {
                t     *= v.first;
                t_sum += t;
            }
            sum *= t_sum;
        }
        return sum;
    }

private:
    const std::vector<ull> list_;

    std::vector<ull> generateList(const ull& n_max) const {
        std::vector<uint> table(n_max + 1, 0);
        std::vector<ull> list;
        for(ull i = 2; i <= n_max; i++) {
            if(table[i] == 0) {
                list.push_back(i);
                for(uint j = i; j <= n_max; j+=i) {
                    table[j] = 1;
                }
            }
        }
        return list;
    }
};

template<typename T>
class CombinationCalcurator {
public:
    CombinationCalcurator(int n_max, T mod):
        mod_(mod),
        factorial_(n_max + 1, 0),
        inv_factorial_(n_max + 1, 0),
        inv_(n_max + 1, 0) {
        std::fill(factorial_.begin(), factorial_.begin() + 2, 1);
        std::fill(inv_factorial_.begin(), inv_factorial_.begin() + 2, 1);
        std::fill(inv_.begin(), inv_.begin() + 2, 1);
        for(int i = 2; i <= n_max; i++) {
            factorial_[i]     = (factorial_[i - 1] * i) % mod_;
            inv_[i]           = mod_ - inv_[mod_ % i] * (mod_ / i) % mod_;
            inv_factorial_[i] = inv_factorial_[i - 1] * inv_[i] % mod_;
        }
    }

    T run(int n, int k) {
        return (n < k || (n < 0 || k < 0)) ? 0 :
            factorial_[n] * (inv_factorial_[k] * inv_factorial_[n - k] % mod_) % mod_;
    }

private:
    T mod_;
    std::vector<T> factorial_;
    std::vector<T> inv_factorial_;
    std::vector<T> inv_;
};

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

    int N, M;
    std::cin >> N >> M;

    CombinationCalcurator<ll> comb(200000, MOD);
    PrimeNumberCalculator p(M);

    auto map = p.generatePrimeFactorizationMap(M);
    auto ans = 1LL;
    for(const auto& v : map) {
        ans *= comb.run(v.second + N - 1, v.second);
        ans %= MOD;
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 5120