#include using namespace std; using ll=long long; using pii=pair; #define all(a) a.begin(),a.end() #define pb push_back #define sz(a) ((int)a.size()) const int N=1000005,mod=998244353; int add(int x, int y){x+=y; if(x>=mod) x-=mod; return x;} int sub(int x, int y){x-=y; if(x<0) x+=mod; return x;} int mul(int x, int y){return ((ll)x)*y%mod;} ll k; int n,mu[N],pw2[N]; void amano_hina_is_the_goat(){ cin >> k >> n; mu[1]=1; for(int i=1; i<=n; ++i){ for(int j=i*2; j<=n; j+=i) mu[j]=sub(mu[j],mu[i]); } pw2[0]=1; for(int i=1; i<=n; ++i) pw2[i]=add(pw2[i-1],pw2[i-1]); int res=0; for(int i=1; i<=n; ++i) if(n%i==0){ int cnt=pw2[n/i]; if(k==1); else cnt=add(cnt,1); res=add(res,mul(mu[i],cnt)); } cout << res << "\n"; } signed main(){ ios_base::sync_with_stdio(0),cin.tie(0); cout << fixed << setprecision(20); int t=1; //cin >> t; while(t--) amano_hina_is_the_goat(); }