#include <bits/stdc++.h>
using namespace std;
const int N = 100000, mod = 1000000007;
int add(int a, int b, int p = mod) { return a + b >= p ? a + b - p : a + b; }
int sub(int a, int b, int p = mod) { return a - b < 0 ? a - b + p : a - b; }
int mul(int a, int b, int p = mod) { return 1LL * a * b % p; }
void sadd(int &a, int b, int p = mod) { a = add(a, b, p); }
void ssub(int &a, int b, int p = mod) { a = sub(a, b, p); }
void smul(int &a, int b, int p = mod) { a = mul(a, b, p); }
int Power(int a, int k, int p = mod) {
  int res = 1;
  for (; k; k >>= 1, smul(a, a, p))
    if (k & 1) smul(res, a, p);
  return res;
}
int Get_inv(int a, int p = mod) { return Power(a, p - 2, p); }
int n;
void into() { scanf("%d", &n); }
int b[N + 9], pr[N + 9], cp;
int mu[N + 9];
void Sieve() {
  for (int i = 2; i <= n; ++i) {
    if (!b[i]) pr[++cp] = i, mu[i] = mod - 1;
    for (int j = 1; j <= cp && i * pr[j] <= n; ++j) {
      int t = i * pr[j];
      b[t] = 1;
      if (i % pr[j] == 0) {
        mu[t] = 0;
        break;
      }
      mu[t] = mu[i] ? mod - mu[i] : 0;
    }
  }
}
int inv[N + 9];
void Get_inv() {
  inv[1] = 1;
  for (int i = 2; i <= n; ++i) inv[i] = mul(mod - mod / i, inv[mod % i]);
}
int ans;
void Get_ans() {
  ans = 1;
  for (int i = 2; i <= n; ++i) {
    int t = mul(mu[i], mul(n / i, inv[n - n / i]));
    ssub(ans, t);
  }
}
void work() {
  Sieve();
  Get_inv();
  Get_ans();
}
void outo() { printf("%d\n", ans); }
int main() {
  int T = 1;
  for (; T--;) {
    into();
    work();
    outo();
  }
  return 0;
}
