#include #include #include #define MOD 1000000007 #define N_MAX 1000001 using namespace std; typedef long long ll; typedef pair P; ll inv[N_MAX],fac[N_MAX],finv[N_MAX]; ll pow2[N_MAX]; bool isPrime[N_MAX]; int W, B, N; void init(){ fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; pow2[0] = 1; pow2[1] = 2; for(int i=2;i> N >> K; ll ans = 0; vector v; for(ll i = 2; i <= N; i++){ if(N%i == 0 && K%i == 0) { v.push_back(N/i); } } sort(v.begin(), v.end()); for(int i = 0; i < v.size(); i++){ int cnt = 0; for(int j = i+1; j < v.size(); j++){ if(v[j]%v[i] == 0) cnt++; } // cout << v[i] << ' '; int k = N/v[i]; ans += (1-cnt)*comb(N/k, K/k); ans %= MOD; } cout << ans << endl; }