#include <bits/stdc++.h>
const int mod = 1e9 + 7;
const int maxn = 1e5 + 5;
int m, cnt, ans = 1;
int pri[maxn], mo[maxn], inv[maxn];
bool vis[maxn];
void init(int n) {
  mo[1] = inv[1] = 1;
  for (int i = 2; i <= n; ++i) {
    inv[i] = 1LL * inv[mod % i] * (mod - mod / i) % mod;
    if (!vis[i]) vis[i] = 1, pri[++cnt] = i, mo[i] = -1;
    for (int t = 1; t <= cnt && pri[t] * i <= n; ++t) {
      vis[i * pri[t]] = 1;
      if (i % pri[t] == 0) break;
      mo[i * pri[t]] = -mo[i];
    }
  }
  for (int i = 2; i <= n; ++i) mo[i] += mo[i - 1];
}
int main() {
  scanf("%d", &m);
  init(1e5);
  for (int l = 2, r; l <= m; l = r + 1) {
    r = m / (m / l);
    ans = (ans - 1LL * (mo[r] - mo[l - 1]) * (m / l) % mod * inv[m - (m / l)]) %
          mod;
  }
  printf("%d", (ans + mod) % mod);
  return 0;
}
