n,m = map(int,input().split()) def factorization(n): relist = [] if n == 1: relist = 1 for i in range(2, int(n ** 0.5) + 1): #割る数 while n % i == 0: relist.append(i) n /= i if n != 1: relist.append(int(n)) return relist x = factorization(m) import collections y = collections.Counter(x) mod = 998244353 ans = 1 for i in y: z = y[i] ans *= pow(z+1,n,mod) - pow(z,n,mod) ans %= mod print(ans)