#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, T b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, T b) {
  return b > a ? a = b, 1 : 0;
}
inline int read() {
  int x(0), sgn(1);
  char ch(getchar());
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') sgn = -1;
  for (; isdigit(ch); ch = getchar()) x = (x * 10) + (ch ^ 48);
  return x * sgn;
}
void File() {}
const int N = 1e5 + 1e3;
int mu[N], prime[N], pcnt;
bitset<N> is_prime;
void Linear_Sieve(int maxn) {
  is_prime.set();
  for (register int i = (2), iend = (int)(maxn); i <= iend; ++i) {
    if (is_prime[i]) prime[++pcnt] = i, mu[i] = -1;
    for (int j = 1, res; (res = prime[j] * i) <= maxn && j <= pcnt; ++j) {
      is_prime[res] = false;
      if (i % prime[j])
        mu[res] = -mu[i];
      else
        break;
    }
  }
}
const int Mod = 1e9 + 7;
inline int fpm(int x, int power) {
  int res = 1;
  for (; power; power >>= 1, x = 1ll * x * x % Mod)
    if (power & 1) res = 1ll * res * x % Mod;
  return res;
}
int main() {
  File();
  int n = read();
  Linear_Sieve(n);
  int ans = 1;
  for (register int d = (2), dend = (int)(n); d <= dend; ++d) {
    int p = 1ll * (n / d) * fpm(n, Mod - 2) % Mod;
    ans = (ans - 1ll * mu[d] * p * fpm(Mod + 1 - p, Mod - 2)) % Mod;
  }
  ans = (ans + Mod) % Mod;
  printf("%d\n", ans);
  return 0;
}
