Problem:
Score : 400 points

Problem Statement

You are given positive integers N and M.

How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M? Find the count modulo 10^9+7.

Here, two sequences a' and a'' are considered different when there exists some i such that a_i' \neq a_i''.

Constraints

All values in input are integers.

1 \leq N \leq 10^5

1 \leq M \leq 10^9

Input

Input is given from Standard Input in the following format:

N M

Output

Print the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.

Sample Input 1

2 6

Sample Output 1

4

Four sequences satisfy the condition: \{a_1, a_2\} = \{1, 6\}, \{2, 3\}, \{3, 2\} and \{6, 1\}.

Sample Input 2

3 12

Sample Output 2

18

Sample Input 3

100000 1000000000

Sample Output 3

957870001

Solution in Rust (1.15.1) (judge verdict: Wrong Answer)

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn calcComb(a: i64, b: i64, modulo: i64) -> i64 {
    if b > a - b {
        return calcComb(a, a - b, modulo);
    }
    let mut ansMul: i64 = 1;
    let mut ansDiv: i64 = 1;
    for i in 0..b {
        ansMul *= (a - i);
        ansDiv *= (i + 1);
        ansMul %= modulo;
        ansDiv %= modulo;
    }
    let ans = ansMul * modpow(ansDiv, modulo - 2, modulo);
    ans
}

fn modpow(a: i64, p: i64, modulo: i64) -> i64 {
    if p == 0 {
        1
    } else if p % 2 == 0 {
        let halfP = (p as f64 / 2.0) as i64;
        let half = modpow(a, halfP, modulo) % modulo;

        (half * half) % modulo
    } else {
        (a * modpow(a, p - 1, modulo)) % modulo
    }
}

fn main() {
    input! {
        N: i64,
        M: i64,
    }

    let modulo = 1000000007;
    let mut MNokori = M;
    let mut ans: i64 = 1;

    let mut i = 2;
    while i * i <= MNokori {
        if MNokori % i == 0 {
            let mut cnt = 0;
            while MNokori % i == 0 {
                cnt += 1;
                MNokori = (MNokori as f32 / i as f32) as i64;
            }
            ans *= calcComb(cnt + N - 1, N - 1, modulo);
            ans %= modulo;
        }
        i += 1;
    }

    if MNokori != 1 {
        ans *= calcComb(1 + N - 1, N - 1, modulo);
        ans %= modulo;
    }
    println!("{}", ans);
}