import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.functional;

enum K = 1_000_000_007;

void main() {

    const tmp = readln.split.to!(long[]);
    const N = tmp[0], M = tmp[1];

    if (M == 1) {
        writeln(1);
        return;
    }

    const primes = primeFactorize(M);

    const po = primes.values.reduce!max + 1;

    long[][] combiTable = new long[][](N+po,po);
    foreach (i; 0..N+po) {
        foreach (j; 0..po) {
            if (i < j) continue;
            if (j == 0) {
                combiTable[i][j] = 1;
                continue;
            }
            combiTable[i][j] = (combiTable[i-1][j] + combiTable[i-1][j-1]) % K;
        }
    }

    primes.values.map!(c => combiTable[c + N - 1][c] % K).reduce!((a,b) => a * b % K).writeln;
}

long[long] primeFactorize(long x) {
    if (x == 1) return typeof(return).init;
    auto y = 2;
    while (y <= x) {
        if (x % y == 0) {
            auto po = memoize!primeFactorize(x/y);
            po[y]++;
            return po;
        }
        y++;
    }
    assert(false);
}
