#include <bits/stdc++.h>
using namespace std;
const long long p = (long long)1e9 + 7;
int n;
int prime[100010], mu[100010];
bool check[100010];
vector<int> fac[100010];
void init() {
  memset(check, 0, sizeof check);
  prime[0] = 0;
  mu[1] = 1;
  for (int i = 2; i < 100010; ++i) {
    if (!check[i]) {
      prime[++prime[0]] = i;
      mu[i] = -1;
    }
    for (int j = 1; j <= prime[0]; ++j) {
      if (1ll * i * prime[j] >= 100010) {
        break;
      }
      check[i * prime[j]] = 1;
      if (i % prime[j] == 0) {
        mu[i * prime[j]] = 0;
        break;
      } else {
        mu[i * prime[j]] = -mu[i];
      }
    }
  }
  for (int i = 1; i < 100010; ++i) {
    for (int j = i; j < 100010; j += i) {
      fac[j].push_back(i);
    }
  }
}
long long f[100010], inv[100010];
int main() {
  init();
  while (scanf("%d", &n) != EOF) {
    inv[1] = 1;
    for (int i = 2; i <= n; ++i) {
      inv[i] = inv[p % i] * (p - p / i) % p;
    }
    f[1] = 1;
    for (int i = 2; i <= n; ++i) {
      long long t = 0;
      for (auto it : fac[i])
        if (it != i) {
          long long tt = 0;
          for (auto it2 : fac[i / it]) {
            tt = (tt + mu[it2] * (n / it / it2) % p + p) % p;
          }
          t = (t + f[it] * tt % p) % p;
        }
      f[i] = (1 + t * inv[n] % p) % p;
      f[i] = f[i] * n % p * inv[n - n / i] % p;
    }
    long long res = 0;
    for (int i = 1; i <= n; ++i) {
      res = (res + f[i]) % p;
    }
    printf("%lld\n", res * inv[n] % p);
  }
  return 0;
}
