#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long p = 1e9 + 7;
long long dp[N];
long long mult(long long a, long long b) {
  long long res = a * b % p;
  if (res < 0) res += p;
  return res;
}
long long add(long long a, long long b) {
  long long res = a + b;
  if (res < -p)
    res += 2 * p;
  else if (res < 0)
    res += p;
  else if (res >= p)
    res -= p;
  return res;
}
long long sub(long long a, long long b) { return add(a, -b); }
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = mult(res, a);
    b >>= 1;
    a = mult(a, a);
  }
  return res;
}
long long divi(long long a, long long b) { return mult(a, binpow(b, p - 2)); }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    long long cur = 1;
    vector<int> divs = {1};
    for (int j = 2; j * j <= i; j++) {
      if (i % j != 0) continue;
      divs.push_back(j);
      divs.push_back(i / j);
      if (j * j == i) divs.pop_back();
    }
    for (int y : divs) {
      int a = i / y;
      int up = n / y;
      vector<int> primes;
      for (int j = 2; j * j <= a; j++) {
        if (a % j == 0) {
          primes.push_back(j);
          while (a % j == 0) a /= j;
        }
      }
      if (a > 1) primes.push_back(a);
      int k = primes.size();
      int K = 1 << k;
      int cnt = up;
      for (int mask = 1; mask < K; mask++) {
        int kek = 1;
        for (int j = 0; j < k; j++) {
          if (mask & (1 << j)) {
            kek *= primes[j];
          }
        }
        kek = up / kek;
        if (__builtin_popcount(mask) & 1) kek *= -1;
        cnt += kek;
      }
      cur = add(cur, divi(mult(dp[y], cnt), n));
    }
    dp[i] = divi(cur, sub(1, divi(n / i, n)));
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = add(ans, divi(dp[i], n));
  cout << ans << "\n";
  return 0;
}
