#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; #define fi first #define se second #define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++) #define rep(i,n) repl(i,0,n) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<y?x:y) #define mmin(x,y) (x0){ if(n&1)res=res*a%mod; a=a*a%mod; n>>=1; } return res; } bool vis[1000010]; ll res[1000010]; ll fac[1000010],finv[1000010]; ll comb(ll n,ll r){ if(n<0||r<0||n>N>>K; repl(i,1,N){ ll g=gcd(N,i); if(vis[g])continue; vis[g]=true; ll A=N/g; ll B=N/A; if(K%A==0){ ll cnt=K/A; res[g]+=comb(B,cnt); res[g]%=mod; } } ll sum=0; for(ll i=1;i<=N;i++){ if(vis[i])(sum+=res[i])%=mod; for(ll j=2*i;j<=N;j+=i)(res[j]+=mod-res[i])%=mod; } cout<