#include <bits/stdc++.h>
using std::vector;
int rd() {
  int k = 0;
  char c = getchar();
  while (c > '9' || c < '0') c = getchar();
  while (c >= '0' && c <= '9') k = k * 10 + c - '0', c = getchar();
  return k;
}
const int N = 100001, M = 1000000007;
int m, P[N], s, mu[N], p[N], inv[N], ans;
int main() {
  m = rd(), mu[1] = inv[1] = 1;
  for (int i = 2; i <= m; ++i) {
    if (!p[i]) P[++s] = i, mu[i] = -1;
    for (int j = 1, k; j <= s && (k = P[j] * i) <= m; ++j) {
      p[k] = 1;
      if (i % P[j] == 0) break;
      mu[k] = -mu[i];
    }
    inv[i] = (M - (long long)(M / i) * inv[M % i] % M) % M;
  }
  for (int i = 2; i <= m; ++i)
    ans = (ans + (long long)mu[i] * (m / i) % M * inv[m - m / i] % M + M) % M;
  printf("%d\n", (M + 1 - ans) % M);
  return 0;
}
