from itertools import accumulate MOD = 10 ** 9 + 7 N, M = map(int, input().split()) isprime = [1] * (10 ** 6 + 1) isprime[0], isprime[1] = 0, 0 prime_list = [] for p in range(2, 10 ** 6 + 1): if isprime[p] == 0: continue prime_list.append(p) i = 2 * p while i <= 10 ** 6: isprime[i] = 0 i += p ans = 1 for p in prime_list: if M % p != 0: continue cnt = 0 while M % p == 0: cnt += 1 M //= p dp = [0] * (cnt + 1) dp[0] = 1 for _ in range(N): s = 0 ndp = [] for i in range(cnt + 1): s = (s + dp[i]) % MOD ndp.append(s) ndp.reverse() dp = ndp res = 0 for i in dp: res = (res + i) % MOD ans = (ans * res) % MOD if M != 1: F = [1, 1] for i in range(N): F.append((F[-1] + F[-2]) % MOD) ans = (ans * F[-1]) % MOD print(ans)