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];

    const primes = primeFactorize(M);

    long[][] combiTable = new long[][](N+100,100);
    foreach (i; 0..N+100) {
        foreach (j; 0..100) {
            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);
}
