#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int n;
long long kpow(long long x, long long n, long long p) {
  long long s = 1;
  while (n) {
    if (n & 1) s = (s * x) % p;
    x = (x * x) % p;
    n = n >> 1;
  }
  return s;
}
long long phi[maxn], mu[maxn], not_prime[maxn], prime[maxn];
int tot = 0;
long long sphi[maxn];
void init() {
  long long i, j;
  phi[1] = 1;
  mu[1] = 1;
  sphi[1] = 1;
  for (i = 2; i < maxn; i++) {
    if (!not_prime[i]) {
      phi[i] = i - 1;
      mu[i] = -1;
      prime[++tot] = i;
    }
    for (j = 1; prime[j] * i < maxn; j++) {
      not_prime[prime[j] * i] = true;
      if (i % prime[j] == 0) {
        phi[prime[j] * i] = phi[i] * prime[j];
        mu[prime[j] * i] = 0;
        break;
      }
      phi[prime[j] * i] = phi[i] * (prime[j] - 1);
      mu[prime[j] * i] = -mu[i];
    }
    sphi[i] = sphi[i - 1] + phi[i];
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  init();
  while (cin >> n) {
    long long ans = 1;
    for (int i = 2; i <= n; i++) {
      ans = (ans -
             (mu[i] * (n / i) * kpow(n - (n / i), 1000000007 - 2, 1000000007)) %
                 1000000007 +
             1000000007) %
            1000000007;
    }
    cout << ans << endl;
  }
}
