#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007, dp[100010], m, inv[100010];
vector<long long> fact[100010];
void inverse() {
  int i;
  inv[1] = 1;
  for (i = 2; i < 100010; i++) {
    inv[i] = mod - (mod / i) * inv[mod % i] % mod;
  }
}
map<long long, long long> mp[100010];
void fz(int n) {
  int i, j, x = n;
  for (i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      n /= i;
      mp[x][i]++;
    }
  }
  if (n != 1) {
    mp[x][n]++;
  }
  mp[x][1]++;
}
long long cnt(long long x, long long y) {
  if (x % y != 0) return 0;
  vector<long long> v;
  for (auto it : mp[x / y]) {
    if (it.first != 1) v.push_back(it.first);
  }
  int i, j, k = m / y, pl, z;
  long long ret = k;
  for (i = 1; i < (1 << (int)v.size()); i++) {
    pl = 1;
    z = 1;
    for (j = 0; j < v.size(); j++) {
      if (i & (1 << j)) {
        pl *= -1;
        z *= v[j];
      }
    }
    z = k / z;
    ret += pl * z;
  }
  return ret;
}
int main() {
  int i, j;
  cin >> m;
  inverse();
  for (i = 2; i <= m; i++) fz(i);
  for (i = 1; i <= m; i++) {
    for (j = i; j <= m; j += i) {
      fact[j].push_back(i);
    }
  }
  dp[1] = 1;
  for (i = 2; i <= m; i++) {
    long long z = m;
    for (long long a : fact[i]) {
      if (a != i) {
        (z += cnt(i, a) * dp[a] % mod) %= mod;
      }
    }
    dp[i] = inv[m - m / i] * z % mod;
  }
  long long ans = 0;
  for (i = 1; i <= m; i++) {
    (ans += dp[i]) %= mod;
  }
  cout << ans * inv[m] % mod << endl;
}
