#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const double eps = 1e-10, Pi = 2 * acos(0);
long long LINF = 1LL << 62;
int n;
long long qpow(long long x, int t) {
  long long res = 1;
  while (t) {
    if (t & 1) res = (res * x) % mod;
    t >>= 1;
    x = (x * x) % mod;
  }
  return res;
}
long long dp[N], tmp[N];
vector<int> G[N];
void solve() {
  scanf("%d", &n);
  long long inv = qpow(n, mod - 2);
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j += i) G[j].push_back(i);
  dp[1] = 0;
  for (int i = 2; i <= n; i++) {
    reverse(G[i].begin(), G[i].end());
    for (int j = 0; j < G[i].size(); j++) {
      int cur = G[i][j];
      tmp[cur] += n / cur;
      for (int k = 0; k < G[cur].size(); k++) {
        int c = G[cur][k];
        if (c != cur) tmp[c] -= tmp[cur];
      }
    }
    long long down = (1 - tmp[i] * inv % mod + mod) % mod;
    long long up = 1;
    for (int j = 0; j < G[i].size(); j++) {
      int cur = G[i][j];
      if (cur != i) up = (up + dp[cur] * tmp[cur] % mod * inv % mod) % mod;
    }
    dp[i] = up * qpow(down, mod - 2) % mod;
    for (int j = 0; j < G[i].size(); j++) {
      tmp[G[i][j]] = 0;
    }
  }
  long long ans = 1;
  for (int i = 1; i <= n; i++) ans = (ans + dp[i] * inv % mod) % mod;
  printf("%lld\n", ans);
}
int main() {
  int ce, c = 1;
  solve();
  return 0;
}
