n_ = 10**6 mod = 10**9 + 7 fun = [1] * (n_ + 1) for i in range(1, n_ + 1): fun[i] = fun[i - 1] * i % mod rev = [1] * (n_ + 1) rev[n_] = pow(fun[n_], mod - 2, mod) for i in range(n_ - 1, 0, -1): rev[i] = rev[i + 1] * (i + 1) % mod def nCr(n, r): if r > n: return 0 return fun[n] * rev[r] % mod * rev[n - r] % mod n, k = map(int, input().split()) res = [0]*(n+1) sieve = [1]*(n+1) for x in range(2,k+1): if n % x == k % x == 0: res[x] = nCr(n//x, k//x) for p in range(2, n+1): if sieve[p]: for i in range(2, n//p+1): sieve[i*p] = 0 res[i] = (res[i] - res[i*p]) % mod print(sum(res) % mod)