#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e5 + 5;
vector<int> d[N];
int pri[N], cntp, mu[N], f[N], g[N], inv[N];
bool vis[N];
void prp(int n) {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) pri[++cntp] = i, mu[i] = -1;
    for (int j = 1; j <= cntp && pri[j] * i <= n; j++) {
      vis[pri[j] * i] = true;
      mu[pri[j] * i] = i % pri[j] ? -mu[i] : 0;
      if (i % pri[j] == 0) break;
    }
  }
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  for (int i = 2; i <= n; i++)
    for (int j = i; j <= n; j += i) d[j].push_back(i);
}
int main() {
  int n;
  scanf("%d", &n);
  prp(n);
  int ans = 1;
  for (int i = 2; i <= n; i++) {
    f[i] = n;
    for (int j = 0; j < (int)d[i].size(); j++) {
      int t = d[i][j];
      f[i] = (f[i] + 1ll * g[t] * (n / t) % mod) % mod;
    }
    f[i] = 1ll * f[i] * inv[n - (n / i)] % mod;
    for (int j = i; j <= n; j += i) g[j] = (g[j] + f[i] * mu[j / i]) % mod;
    ans = (ans + 1ll * f[i] * inv[n] % mod) % mod;
  }
  printf("%d", (ans % mod + mod) % mod);
  return 0;
}
