#include <bits/stdc++.h>
using namespace std;
const long long mm = 1e9 + 7;
const int N = 100000;
int n, tot;
int vis[N + 5];
long long fac[N + 5], inv[N + 5], mu[N + 5], pri[N + 5], f[N + 5], ans;
vector<long long> vec[N + 5];
int main() {
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= N; i++) inv[i] = mm - inv[mm % i] * (mm / i) % mm;
  mu[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (!vis[i]) pri[++tot] = i, mu[i] = -1;
    for (int j = 1; i * pri[j] <= N; j++) {
      vis[i * pri[j]] = 1;
      if (i % pri[j])
        mu[i * pri[j]] = -mu[i];
      else {
        mu[i * pri[j]] = 0;
        break;
      }
    }
  }
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j += i) vec[j].push_back(i);
  f[1] = 1;
  ans = 0;
  for (int i = 1; i <= n; i++) {
    int p = n / i;
    if (i > 1) f[i] = (f[i] + n) * inv[n - p] % mm;
    (ans += f[i]) %= mm;
    for (int j = i + i; j <= n; j += i) {
      long long sum = 0;
      int v = j / i;
      for (auto x : vec[v]) sum += mu[x] * (n / i / x);
      (f[j] += f[i] * sum % mm) %= mm;
    }
  }
  ans = ans * inv[n] % mm;
  printf("%lld\n", ans);
  return 0;
}
