#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } #include using mint = atcoder::modint998244353; int main() { fast_io(); long long k; int n; cin >> k >> n; vector facts; for (int i = 1; i * i <= n; i++) { if (n % i == 0) { facts.push_back(i); if (i * i != n) { facts.push_back(n / i); } } } sort(facts.begin(), facts.end()); int M = facts.size(); vector dp(M); for (int i = 0; i < M; i++) { dp[i] = mint(2).pow(facts[i]) + (k > 1 ? 1 : 0); for (int j = 0; j < i; j++) { if (facts[i] % facts[j] == 0) { dp[i] -= dp[j]; } } } cout << dp[M - 1].val() << endl; }