mod = 1000000007 def main(): import sys input = sys.stdin.readline def PrimeDecomposition(N): ret = {} n = int(N ** 0.5) for d in range(2, n + 1): while N % d == 0: if d not in ret: ret[d] = 1 else: ret[d] += 1 N //= d if N == 1: break if N != 1: ret[N] = 1 return ret N, M = map(int, input().split()) P = PrimeDecomposition(M) ans = 1 for p in P: K = P[p] dp = [0] * (K+1) dp[0] = 1 for _ in range(N): dp_new = [0] * (K+1) for k in range(K+1): for k2 in range(K+1): if k + k2 > K: break dp_new[k2] = (dp_new[k2] + dp[k]) % mod dp = dp_new S = 0 for d in dp: S = (S + d)%mod ans = (ans * S)%mod print(ans) if __name__ == '__main__': main()