#include <bits/stdc++.h>
using namespace std;
const int N = 100010, mod = 1e9 + 7;
int n, res;
vector<int> factor[N];
bool vis[N];
int prime[N], cnt;
int miu[N];
int inv[N];
int dp[N];
void prepare() {
  vis[0] = vis[1] = 1;
  miu[1] = 1;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) prime[cnt++] = i, miu[i] = -1;
    for (int j = 0; j < cnt && i * prime[j] <= n; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j])
        miu[i * prime[j]] = -miu[i];
      else
        break;
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j += i) factor[j].push_back(i);
  inv[1] = 1;
  for (int i = 2; i <= n; i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
}
int calc(int a, int m) {
  int res = 0;
  for (auto i : factor[a]) res += (m / i) * miu[i];
  return res;
}
int main() {
  cin >> n;
  res = n;
  prepare();
  for (int i = 1; i <= n; i++) {
    dp[i] = n;
    for (auto x : factor[i])
      if (x != i) dp[i] = (dp[i] + 1ll * dp[x] * calc(i / x, n / x)) % mod;
    dp[i] = 1ll * dp[i] * inv[n - n / i] % mod;
    res = (res + dp[i]) % mod;
  }
  res = 1ll * res * inv[n] % mod;
  cout << res << endl;
}
