#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1000000007;
const double eps = 1e-6;
const double PI = acos(-1);
int Power(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return ans;
}
void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
int n, ans, dp[N];
int inv[N];
vector<int> fac[N];
vector<int> cnt[N];
int dfs(int x) {
  if (x == 1) return 1;
  if (~dp[x]) return dp[x];
  dp[x] = 0;
  int ret = n / x;
  int res = ((int)fac[x].size());
  add(dp[x], (1ll * inv[n - ret] * n + mod) % mod);
  for (int i = 0; i < ((int)fac[x].size()) - 1; i++) {
    add(dp[x], 1ll * inv[n - ret] * cnt[x][i] % mod * dfs(fac[x][i]) % mod);
  }
  return dp[x];
}
int main() {
  memset(dp, -1, sizeof(dp));
  inv[1] = 1;
  for (int i = 2; i < N; i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  for (int i = 1; i < N; i++)
    for (int j = i; j < N; j += i) fac[j].push_back(i);
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    cnt[i].resize(((int)fac[i].size()));
    for (int j = ((int)fac[i].size()) - 1; j >= 0; j--) {
      cnt[i][j] = n / fac[i][j];
      for (int k = j + 1; k < ((int)fac[i].size()); k++)
        if (fac[i][k] % fac[i][j] == 0) cnt[i][j] -= cnt[i][k];
    }
  }
  for (int i = 1; i <= n; i++) add(ans, 1ll * inv[n] * dfs(i) % mod);
  printf("%d\n", ans);
  return 0;
}
