import sys input = sys.stdin.readline N,M=map(int,input().split()) mod=10**9+7 x=M # 素因数分解 import math L=int(math.sqrt(x)) FACT=dict() for i in range(2,L+2): while x%i==0: FACT[i]=FACT.get(i,0)+1 x=x//i if x!=1: FACT[x]=FACT.get(x,0)+1 def calc(LEN,N): DP=[1]*LEN for tests in range(N-1): NDP=[0]*LEN for j in range(LEN): NDP[LEN-1-j]+=DP[j] DP=[0]*LEN DP[-1]=NDP[-1] for j in range(LEN-2,-1,-1): DP[j]=DP[j+1]+NDP[j] DP[j]%=mod return sum(DP)%mod ANS=1 for f in FACT.values(): ANS*=calc(f+1,N) ANS%=mod print(ANS)