#include <bits/stdc++.h>
const int maxn = 100000 + 10;
const int maxm = 200 + 10;
const int inf_max = 0x3f3f3f;
const int mod = 1000000007;
const double eps = 1e-4;
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int m;
int fastpower(int base, int power) {
  int ret = 1;
  while (power) {
    if (power & 1) ret = 1ll * ret * base % mod;
    base = 1ll * base * base % mod;
    power >>= 1;
  }
  return ret;
}
int dp[maxn], num;
vector<int> v;
void getfac(int x) {
  for (int i = 2; i * i <= x; ++i) {
    if (x % i == 0) {
      v.push_back(i);
      while (x % i == 0) x /= i;
    }
  }
  if (x > 1) v.push_back(x);
}
void dfs(int deep, int status, int cur, int up) {
  if (deep == v.size()) {
    if (status)
      num -= up / cur;
    else
      num += up / cur;
    return;
  }
  dfs(deep + 1, !status, cur * v[deep], up);
  dfs(deep + 1, status, cur, up);
}
int main() {
  cin >> m;
  dp[1] = 0;
  for (int i = 2; i <= m; ++i) {
    int tot = m / i, val = 0;
    for (int j = 1; j * j <= i; ++j) {
      if (i % j) continue;
      num = 0;
      v.clear();
      getfac(i / j);
      dfs(0, 0, 1, m / j);
      val = (val + 1ll * num * dp[j] % mod) % mod;
      int f2 = i / j;
      if (f2 != j && j != 1) {
        num = 0;
        v.clear();
        getfac(i / f2);
        dfs(0, 0, 1, m / f2);
        val = (val + 1ll * num * dp[f2] % mod) % mod;
      }
    }
    dp[i] = 1ll * (m + val) % mod * fastpower(m - tot, mod - 2) % mod;
  }
  int ans = 1;
  for (int i = 1; i <= m; ++i)
    ans = (ans + 1ll * dp[i] * fastpower(m, mod - 2) % mod) % mod;
  cout << ans << endl;
  return 0;
}
