using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static long[] NList => ReadLine().Split().Select(long.Parse).ToArray(); static void Main() { var c = NList; var (n, m) = ((int)c[0], c[1]); WriteLine(Divisor(n, m)); } static long Divisor(int n, long m) { var plist = PDiv(m); var dic = new Dictionary(); for (var i = 0; i < plist.Count; ++i) dic.Add(plist[i], i); var tree = new List[plist.Count]; for (var i = 0; i < tree.Length; ++i) { tree[i] = new List(); for (var j = 0; j < plist.Count; ++j) { if (m % ((decimal)plist[i] * plist[j]) == 0) tree[i].Add(j); } } var dp = Enumerable.Repeat(1L, plist.Count).ToArray(); var mod = 1_000_000_007; for (var i = 1; i < n; ++i) { var next = new long[plist.Count]; for (var p = 0; p < dp.Length; ++p) foreach (var v in tree[p]) { next[v] = (next[v] + dp[p]) % mod; } dp = next; } return (dp.Sum() % mod); } static List PDiv(long x) { var list = new List(); var rev = new List(); for (var i = 1L; i * i <= x; ++i) if (x % i == 0) { list.Add(i); if (i * i < x) rev.Add(x / i); } rev.Reverse(); return list.Concat(rev).ToList(); } }