#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int prime[100010] = {0};
bool vis[100010] = {0};
long long m, mu[100010], inv[100010];
long long power(long long a, long long b) {
  long long s = 1, ss = a;
  while (b) {
    if (b & 1) s = s * ss % mod;
    ss = ss * ss % mod;
    b >>= 1;
  }
  return s;
}
void calc_mu() {
  mu[1] = 1ll;
  for (int i = 2; i <= m; i++) {
    if (!vis[i]) {
      prime[++prime[0]] = i;
      mu[i] = mod - 1ll;
    }
    for (int j = 1; j <= prime[0] && i * prime[j] <= m; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j] == 0) {
        mu[i * prime[j]] = 0;
        break;
      }
      mu[i * prime[j]] = mu[i] * (mod - 1ll) % mod;
    }
  }
}
int main() {
  scanf("%lld", &m);
  inv[1] = 1ll;
  for (long long i = 2; i <= m; i++)
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
  calc_mu();
  long long ans = 0;
  for (long long d = 2; d <= m; d++)
    ans = (ans + mu[d] * (m / d) % mod * inv[m - m / d]) % mod;
  printf("%lld", (1ll - ans + mod) % mod);
  return 0;
}
