N,M=map(int,input().split()) mod=998244353 def fact(x): LIST=[] for i in range(1,round(x**(1/2))+2): if x%i==0: LIST.append(i) LIST.append(x//i) return set(LIST) ANS=dict() SA=sorted(fact(M)) for a in SA: L=fact(a) score=pow(len(L),N,mod) for k in L: if k==a: continue score-=ANS[k] ANS[a]=score print(ANS[M]%mod)