#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool read(T &x) {
  long long f = 1, c = getchar();
  x = 0;
  while (!isdigit(c)) {
    if (c == 45) f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x *= f, true;
}
template <typename T, typename... Args>
inline bool read(T &x, Args &...args) {
  return read(x) && read(args...);
}
namespace run {
const long long maxn = 1e5 + 10, mod = 1e9 + 7;
long long mu[maxn], prime[maxn], cnt;
bool vis[maxn];
long long n, ans, res;
inline long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = 1ll * res * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return res;
}
inline void init(long long n) {
  mu[1] = 1;
  for (register long long i = 2; i <= n; ++i) {
    if (!vis[i]) prime[++cnt] = i, mu[i] = -1;
    for (register long long j = 1; j <= cnt && i * prime[j] <= n; ++j) {
      vis[i * prime[j]] = true;
      if (i % prime[j] == 0) {
        mu[i * prime[j]] = 0;
        break;
      }
      mu[i * prime[j]] = -mu[i];
    }
  }
  return;
}
inline long long main() {
  read(n);
  init(n);
  ans = 1;
  for (register long long i = 2; i <= n; ++i) {
    long long tmp = n / i;
    ans = (ans - mu[i] * tmp % mod * power(n - tmp, mod - 2) % mod + mod) % mod;
  }
  printf("%d\n", ans);
  return 0;
}
}  // namespace run
int main() { return run ::main(); }
