import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### n,m = na() mod = 10**9+7 x = [] for i in range(2,int(m**0.5)+2): if m % i == 0: z = 0 while m % i == 0: m //= i z += 1 x.append(z) if m != 1: x.append(1) ans = 1 for y in x: dp = [0]*(y+1) dp[0] = 1 for i in range(n): rui = [0] for j in range(y+1): rui.append((rui[-1]+dp[j])%mod) for j in range(y+1): dp[j] = rui[-1-j] #print(dp) ans *= sum(dp)%mod ans %= mod print(ans)