#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;
    #[allow(dead_code)]
    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }
    #[allow(dead_code)]
    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }
    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }
    #[allow(dead_code)]
    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}
#[allow(unused_macros)]
macro_rules ! get { ( [ $ t : ty ] ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . split_whitespace ( ) . map ( | t | t . parse ::<$ t > ( ) . unwrap ( ) ) . collect ::< Vec < _ >> ( ) } } ; ( [ $ t : ty ] ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( [ $ t ] ) ) . collect ::< Vec < _ >> ( ) } ; ( $ t : ty ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; line . trim ( ) . parse ::<$ t > ( ) . unwrap ( ) } } ; ( $ ( $ t : ty ) ,* ) => { { let mut line : String = String :: new ( ) ; stdin ( ) . read_line ( & mut line ) . unwrap ( ) ; let mut iter = line . split_whitespace ( ) ; ( $ ( iter . next ( ) . unwrap ( ) . parse ::<$ t > ( ) . unwrap ( ) , ) * ) } } ; ( $ t : ty ; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ ( $ t : ty ) ,*; $ n : expr ) => { ( 0 ..$ n ) . map ( | _ | get ! ( $ ( $ t ) ,* ) ) . collect ::< Vec < _ >> ( ) } ; }
#[allow(unused_macros)]
macro_rules ! debug { ( $ ( $ a : expr ) ,* ) => { eprintln ! ( concat ! ( $ ( stringify ! ( $ a ) , " = {:?}, " ) ,* ) , $ ( $ a ) ,* ) ; } }
const BIG_STACK_SIZE: bool = true;
#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

struct Comb {
    div: i64,
    g1: Vec<i64>,
    g2: Vec<i64>,
}

impl Comb {
    fn new(nmax: usize) -> Self {
        let mut g1 = vec![1; nmax+1];
        let mut g2 = vec![1; nmax+1];
        let mut inv = vec![0; nmax+1];
        inv[1] = 1;
        let div = 1000000007;
        for i in 2..(nmax+1) {
            g1[i] = (g1[i-1]*i as i64) % div;
            inv[i] = (inv[div as usize % i] * (div/i as i64) * (-1)) % div;
            g2[i] = (g2[i-1]*inv[i]) % div;
        }
        Comb {
            div: div,
            g1: g1,
            g2: g2,
        }
    }

    fn compute(&self, n: usize, k: usize) -> i64 {
        (((self.g1[n] * self.g2[k]) % self.div) * self.g2[n-k]) % self.div
    }
}

fn solve() {
    let (n, mut m) = get!(u64, u64);

    let mut set = BTreeSet::new();
    let mut vec = Vec::new();

    if m == 1 {
        println!("1");
        return;
    }

    while m > 1 {
        for i in *(set.iter().last().unwrap_or(&2)).. {
            if m % i == 0 {
                m /= i;
                set.insert(i);
                vec.push(i);
                break;
            }
        }
    }
    let mut count = Vec::new();
    for e in set {
        count.push(vec.iter().filter(|t| **t == e).count() as u64);
    }

    let maxt = count.iter().max().unwrap();
    let comb = Comb::new((maxt + n) as usize);
    let mut mul = 1;
    for e in &count {
        mul = (mul * comb.compute((*e+n-1) as usize, (n-1) as usize)) % comb.div;
    }
    if mul < 0 {
        println!("{}", mul + comb.div);
    } else {
        println!("{}", mul);
    }
}


Measured memory_bytes: 10620