#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 5, mod = 1e9 + 7;
long long int expo(long long int b, long long int e, long long int m) {
  long long int a = 1;
  while (e != 0) {
    if ((e & 1) == 1) a = (a * b) % m;
    b = (b * b) % m;
    e >>= 1;
  }
  return a % m;
}
int main() {
  long long int n;
  cin >> n;
  long long int nm[n + 1], dm[n + 1];
  nm[1] = expo(n, mod - 2, mod);
  long long int ans = nm[1];
  for (long long int i = n; i >= 2; i--) {
    long long int p = n / i;
    nm[i] = 2 * n * p - p * p;
    nm[i] %= mod;
    dm[i] = n * (n - p);
    dm[i] %= mod;
    dm[i] = expo(dm[i], mod - 2, mod);
    nm[i] = (nm[i] * dm[i]) % mod;
    for (long long int j = i + i; j < n + 1; ++j) {
      nm[i] -= nm[j];
      nm[i] += mod;
      nm[i] %= mod;
      j += i - 1;
    }
    ans += nm[i];
    ans %= mod;
  }
  cout << ans << "\n";
  return 0;
}
