#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
const int N = 1e5 + 228;
ll pw(ll a, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) {
      res *= a;
      res %= mod;
      --n;
    } else {
      a *= a;
      a %= mod;
      n /= 2;
    }
  }
  return res;
}
ll n;
ll dp[N];
vector<ll> dv[N];
vector<ll> pr[N];
bool is_pr[N];
ll get_cnt(ll x, ll y) {
  ll ans = 0;
  for (int i = 0; i < (1 << pr[x].size()); ++i) {
    ll cur = 1;
    ll sg = 1;
    for (int j = 0; j < (int)pr[x].size(); ++j) {
      if ((i >> j) & 1) {
        sg = mod - sg;
        cur *= pr[x][j];
      }
    }
    ans = (ans + sg * (y / cur)) % mod;
  }
  return ans;
}
int main() {
  scanf("%lld", &n);
  for (int i = 1; i <= n; ++i) {
    for (int j = i; j <= n; j += i) {
      dv[j].push_back(i);
    }
  }
  for (int i = 2; i <= n; ++i) {
    if (!is_pr[i]) {
      for (int j = i; j <= n; j += i) {
        is_pr[j] = true;
        pr[j].push_back(i);
      }
    }
  }
  dp[1] = 0;
  for (int i = 2; i <= n; ++i) {
    dp[i] = n;
    for (int j = 0; j < (int)dv[i].size() - 1; ++j) {
      dp[i] =
          (dp[i] + dp[dv[i][j]] * get_cnt(i / dv[i][j], n / dv[i][j])) % mod;
    }
    dp[i] = dp[i] * pw(n - n / i, mod - 2) % mod;
  }
  ll ans = n;
  for (int i = 1; i <= n; ++i) {
    ans = (ans + dp[i]) % mod;
  }
  printf("%lld\n", ans * pw(n, mod - 2) % mod);
  return 0;
}
