use std::collections::HashMap; use std::io::Write; /* ----------------------------------------------- */ fn d(m: usize) -> Vec { let mut y = m; let mut v = Vec::::with_capacity(30); for x in 2..(m as f64).sqrt() as usize + 5 { if y % x == 0 { let mut c = 0; while y % x == 0 { y /= x; c += 1; } v.push(c); } } if y > 1 { v.push(1); } return v; } fn mul(a: &Vec>, b: &Vec>, md: i64) -> Vec> { let h = a.len(); let w = b[0].len(); let p = a[0].len(); let mut ret = vec![vec![0; w]; h]; for i in 0..h { for j in 0..w { for k in 0..p { ret[i][j] += (a[i][k] * b[k][j]) % md; if ret[i][j] >= md { ret[i][j] -= md; } } } } return ret; } fn dp(n: usize, size: usize, md: i64) -> i64 { let mut mat = vec![vec![0; size + 1]; size + 1]; for i in 0..mat.len() { for j in 0..mat[0].len() - i { mat[i][j] = 1; } } let mut val = vec![vec![0; mat.len()]; mat[0].len()]; for i in 0..mat.len() { val[i][i] = 1; } let mut k = n - 1; while k > 0 { if k & 1 == 1 { val = mul(&val, &mat, md); } mat = mul(&mat, &mat, md); k >>= 1; } let cor: Vec = val .into_iter() .reduce(|ac, it| ac.into_iter().zip(it).map(|(a, b)| (a + b) % md).collect()) .unwrap(); return cor.iter().sum::() % md; } fn run(sc: &mut scanner::Scanner, out: &mut std::io::BufWriter) { let md: i64 = 1000000007; let n: usize = sc.next(); let m: usize = sc.next(); let mut ans = 1; let mut map = HashMap::::new(); for x in d(m) { let p = map.entry(x).or_insert(0); if *p == 0 { *p = dp(n, x, md); } ans *= *p; ans %= md; } writeln!(out, "{}", ans).ok(); } /* ----------------------------------------------- */ #[allow(dead_code)] mod scanner { use std::str::FromStr; pub struct Scanner<'a> { it: std::str::SplitWhitespace<'a>, } impl<'a> Scanner<'a> { pub fn new(s: &'a String) -> Scanner<'a> { Scanner { it: s.split_whitespace(), } } pub fn next(&mut self) -> T { self.it.next().unwrap().parse::().ok().unwrap() } pub fn next_bytes(&mut self) -> Vec { self.it.next().unwrap().bytes().collect() } pub fn next_chars(&mut self) -> Vec { self.it.next().unwrap().chars().collect() } pub fn next_vec(&mut self, len: usize) -> Vec { (0..len).map(|_| self.next()).collect() } } } /* ----------------------------------------------- */ fn main() { use std::io::Read; let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); let mut sc = scanner::Scanner::new(&s); let out = std::io::stdout(); let mut out = std::io::BufWriter::new(out.lock()); run(&mut sc, &mut out); } /* ----------------------------------------------- */