#include <bits/stdc++.h>
using namespace std;
const int N = 100010, mod = 1e9 + 7;
vector<int> v[N];
bool b[N];
int n, p[N], mu[N], tot = 0;
long long f[N];
int ksm(int a, int b) {
  int res = 1;
  for (; b; a = 1ll * a * a % mod, b >>= 1)
    if (b & 1) res = 1ll * res * a % mod;
  return res;
}
int calc(int x, int y) {
  int g = x / y, ans = 0;
  for (int i = 0; i < (int)v[g].size(); ++i)
    ans += mu[v[g][i]] * (n / v[g][i] / y);
  return ans;
}
int main() {
  scanf("%d", &n);
  f[1] = 1;
  mu[1] = 1;
  for (int i = (2); i <= (n); i++) {
    if (!b[i]) p[++tot] = i, mu[i] = -1;
    for (int j = 1; j <= tot && i * p[j] <= n; ++j) {
      b[i * p[j]] = 1;
      if (i % p[j])
        mu[i * p[j]] = -mu[i];
      else {
        mu[i * p[j]] = 0;
        break;
      }
    }
  }
  for (int i = (1); i <= (n); i++)
    for (int j = i; j <= n; j += i) v[j].push_back(i);
  long long ans = 1, inv = ksm(n, mod - 2);
  for (int i = (2); i <= (n); i++) {
    for (int j = 0; j < (int)v[i].size() - 1; ++j)
      f[i] = (f[i] + calc(i, v[i][j]) * f[v[i][j]] % mod) % mod;
    f[i] = (f[i] * inv + 1) % mod;
    long long g = n - calc(i, i);
    f[i] = f[i] * n % mod * ksm(g, mod - 2) % mod;
    ans = (ans + f[i]) % mod;
  }
  printf("%lld\n", ans * ksm(n, mod - 2) % mod);
  return 0;
}
