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 moves = new bool[plist.Count][]; for (var i = 0; i < moves.Length; ++i) { moves[i] = new bool[plist.Count]; for (var j = 0; j < moves[i].Length; ++j) { if (m % ((decimal)plist[i] * plist[j]) == 0) moves[i][j] = true; } } 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) for (var v = 0; v < next.Length; ++v) if (moves[p][v]) { 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(); } }