#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const long long M = 1e9 + 7;
int n, cnt, mu[N], pri[N];
vector<int> fa[N];
bool is[N];
long long _n, dp[N];
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d = a;
  if (b != 0) {
    d = exgcd(b, a % b, y, x);
    y -= (a / b) * x;
  } else {
    x = 1;
    y = 0;
  }
  return d;
}
long long mod_inv(long long a, long long m) {
  long long x, y;
  exgcd(a, m, x, y);
  return (m + x % m) % m;
}
void init() {
  mu[1] = 1;
  is[1] = 1;
  for (int i = 1; i < N; i++) {
    if (!is[i]) {
      pri[cnt++] = i;
      mu[i] = -1;
    }
    for (int j = i; j < N; j += i) {
      fa[j].push_back(i);
    }
    for (int j = 0; j < cnt; j++) {
      int k = i * pri[j];
      if (k >= N) break;
      is[k] = 1;
      if (i % pri[j] == 0) {
        mu[k] = 0;
        break;
      } else
        mu[k] = -mu[i];
    }
  }
  _n = mod_inv(n, M);
}
long long cal(long long n, long long x) {
  long long res = 0;
  for (int y : fa[x]) {
    res += n / y * mu[y];
  }
  return res;
}
long long solve() {
  dp[1] = 0;
  for (int u = 2; u <= n; u++) {
    long long tmp = 0;
    for (int i = 0; i < fa[u].size() - 1; i++) {
      int v = fa[u][i];
      long long c = cal(n / v, u / v);
      tmp += c * _n % M * dp[v] % M;
    }
    tmp++;
    tmp %= M;
    dp[u] = tmp * mod_inv((1 - (n / u) * _n % M + M) % M, M) % M;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += dp[i];
  }
  ans %= M;
  ans = ans * _n % M;
  ans++;
  ans %= M;
  return ans;
}
int main() {
  scanf("%d", &n);
  init();
  printf("%lld\n", solve());
}
