#include #include #include #include #include #include using namespace std; #define int long long #define endl "\n" const long long INF = (long long)1e18; const long long MOD = 1'000'000'007; string yn(bool f){return f?"Yes":"No";} string YN(bool f){return f?"YES":"NO";} #define MAX_VAL 1100000 long long fac[MAX_VAL], mmi[MAX_VAL]; void factorial_mod(){ fac[0]=fac[1]=1; for(long long i = 2; i < MAX_VAL; fac[i]%=MOD,i++) fac[i] = fac[i-1]*(i%MOD); } long long power_mod(long long x, long long n){ long long ans = 1; for(;n;n>>=1,x*=x,ans%=MOD,x%=MOD) if(n&1)ans*=x; return ans%MOD; } void exgcd(int a, int b, int &x, int &y){ if(b == 0){ x = 1; y = 0; return ; } exgcd(b,a%b,y,x); y -= a/b * x; } void modular_multiplicatibe_inverse(){ int x, y; exgcd(fac[MAX_VAL-1],MOD,x,y); mmi[MAX_VAL-1] = x; for(long long i = MAX_VAL-2; i >= 0; mmi[i]%=MOD,i--) mmi[i] = mmi[i+1]*((i+1)%MOD); } long long combination(long long n, long long r){ return n < r ? 0 :fac[n]*(mmi[r]*mmi[n-r]%MOD)%MOD; } signed main(){ cin.tie(0); ios::sync_with_stdio(false); cout< hoge; cin>>N>>K; factorial_mod(); modular_multiplicatibe_inverse(); for(int i = 2; i <= N; i++){ if(N%i == 0){ if(K%i == 0) ans += combination(N/i, K/i)%MOD; for(int j = i * 2; j <= N; j++){ if(K%i == 0) ans -= combination(N/i, K/i)%MOD; ans += MOD; ans %= MOD; } } } cout<