import collections #素因数分解 def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a N,M = map(int, input().split()) CP = collections.Counter(prime_factorize(M)) mod = 998244353 ans = 1 V = list(CP.values())#各素因数の指数を算出 for v in V: ans=ans*(pow(v+1,N,mod)-pow(v,N,mod))%mod print(ans)