#[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)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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 main() {
    input! {
        n : usize,
        mut m : u64,
    }

    let MOD = 1000000007;

    let primes: Vec<u64> = (0..)
        .scan(Vec::<u64>::new(), |state, _| {
            let np = match state.last() {
                None => Some(2),
                Some(&2) => Some(3),
                Some(&n) => (1..).map(|x| x * 2 + n).find(|&x| {
                    state
                        .iter()
                        .take_while(|&p| p * p <= x)
                        .all(|&p| x % p != 0)
                }),
            };
            state.push(np.unwrap());
            np
        })
        .take_while(|&x| x <= (MOD as f64).sqrt() as u64)
        .collect();

    // print!("{:?}", primes);

    let comb = Combinaton::new(101010, MOD);

    let mut ans: usize = 1;
    for p in primes.iter() {
        let mut count: usize = 0;
        while m % p == 0 {
            count += 1;
            m /= *p;
        }
        if count > 0 {
            ans = ans * comb.get(count + n - 1, count) % MOD;
        }
    }

    if m > 1 {
        ans = ans * comb.get(n, 1) % MOD;
    }

    println!("{}", ans);
}

pub struct Combinaton {
    fact: Vec<usize>,
    modulo: usize,
}

impl Combinaton {
    pub fn new(max: usize, modulo: usize) -> Combinaton {
        let mut fact = vec![0; max + 1];
        fact[0] = 1;
        fact[1] = 1;
        for i in 2..(max + 1) {
            fact[i] = i * fact[i - 1] % modulo;
        }
        Combinaton {
            fact: fact,
            modulo: modulo,
        }
    }

    pub fn mod_inverse(a: usize, m: usize) -> usize {
        let (_, x, _) = Self::extgcd(a as i64, m as i64);
        (((m as i64 + x) as usize % m) % m) as usize
    }

    fn extgcd(a: i64, b: i64) -> (i64, i64, i64) {
        if b == 0 {
            (a, 1, 0)
        } else {
            let (gcd, x, y) = Self::extgcd(b, a % b);
            (gcd, y, x - (a / b) * y)
        }
    }

    pub fn get(&self, x: usize, y: usize) -> usize {
        assert!(x >= y);
        self.fact[x] * Self::mod_inverse(self.fact[y] * self.fact[x - y] % self.modulo, self.modulo)
            % self.modulo
    }
}


Measured memory_bytes: 4352