#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f;
const long long mo = 1e9 + 7;
inline long long read() {
  char ch = getchar();
  long long x = 0, f = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long ksm(long long a, long long b) {
  long long ret = 1, tmp = a;
  for (; b; b >>= 1, tmp = 1ll * tmp * tmp % mo)
    if (b & 1) ret = 1ll * ret * tmp % mo;
  return ret;
}
long long n, mu[100005], st[100005], tot, ans = 1;
bitset<100005> u;
void pre(long long lim = 1e5) {
  mu[1] = -1;
  for (long long i = 2; i <= lim; i++) {
    if (!u[i]) st[++tot] = i, mu[i] = -1;
    for (long long j = 1; j <= tot && i * st[j] <= lim; j++) {
      u[i * st[j]] = 1;
      if (i % st[j] == 0) {
        mu[i * st[j]] = 0;
        break;
      }
      mu[i * st[j]] = -mu[i];
    }
  }
}
signed main() {
  pre();
  n = read();
  for (long long l = 2; l <= n; l++) {
    long long r = (n / l);
    ans =
        ((ans - 1ll * mu[l] * r % mo * ksm(n - r, mo - 2) % mo) % mo + mo) % mo;
  }
  printf("%d", ans);
  return 0;
}
