#include <bits/stdc++.h>
const int maxn = 100035;
int n, num, cnt, pr[maxn], phi[maxn];
bool vis[maxn];
long long ans, f[maxn];
std::vector<int> fac[maxn], opt;
void makePrime() {
  phi[1] = 1;
  for (int i = 2; i < maxn; i++) {
    if (!vis[i]) pr[++pr[0]] = i, phi[i] = i - 1;
    for (int j = 1, chk = 1; j <= pr[0] && i * pr[j] < maxn && chk; j++)
      if (pr[j] % i)
        phi[i * pr[j]] = phi[i] * (pr[j] - 1);
      else
        chk = 0, phi[i * pr[j]] = phi[i] * pr[j];
  }
  for (int i = 1; i < maxn; i++)
    for (int j = i; j < maxn; j += i) fac[j].push_back(i);
}
int qmi(int a, int b) {
  int ret = 1;
  for (; b; b >>= 1, a = 1ll * a * a % 1000000007)
    if (b & 1) ret = 1ll * ret * a % 1000000007;
  return ret;
}
int dmd;
void dfs(int x, int c, int t) {
  if (x == opt.size())
    ++dmd, cnt += ((t & 1) ? -num / c : num / c);
  else {
    dfs(x + 1, c, t);
    dfs(x + 1, c * opt[x], t + 1);
  }
}
int calc(int p, int d) {
  bool debug = p == 12;
  std::vector<int>().swap(opt), p /= d, num = n / d;
  for (int i = 1; pr[i] <= p; i++)
    if (p % pr[i] == 0) {
      opt.push_back(pr[i]);
      while (p % pr[i] == 0) p /= pr[i];
    }
  cnt = 0, dfs(0, 1, 0);
  return cnt;
}
int main() {
  scanf("%d", &n), ans = 1, f[1] = 0;
  makePrime();
  for (int i = 2; i <= n; i++) {
    int lwr =
        (1 - 1ll * qmi(n, 1000000007 - 2) * (n / i) % 1000000007 + 1000000007) %
        1000000007;
    for (int j = 1; j < fac[i].size() - 1; j++)
      f[i] = (f[i] + 1ll * f[fac[i][j]] * calc(i, fac[i][j]) % 1000000007) %
             1000000007;
    f[i] = 1ll * (1ll * f[i] * qmi(n, 1000000007 - 2) % 1000000007 + 1) *
           qmi(lwr, 1000000007 - 2) % 1000000007;
    ans = (ans + f[i] + 1) % 1000000007;
  }
  printf("%lld\n", 1ll * ans * qmi(n, 1000000007 - 2) % 1000000007);
  return 0;
}
