#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long m, i, j, cnt, prime[100002], mu[100002], inv[100002];
bool vis[100002];
signed main() {
  scanf("%lld", &m);
  for (i = 2; i <= m; i++) {
    if (!vis[i]) prime[++cnt] = i, mu[i] = mod - 1;
    for (j = 1; j <= cnt; j++) {
      if (i * prime[j] > m) break;
      vis[i * prime[j]] = 1;
      if (i % prime[j])
        mu[i * prime[j]] = mod - mu[i];
      else {
        mu[i * prime[j]] = 0;
        break;
      }
    }
  }
  inv[1] = 1;
  for (i = 2; i <= m; i++)
    inv[i] = (mod - (mod / i) * inv[mod % i] % mod) % mod;
  long long ans = 0;
  for (i = 1; i <= m; i++)
    ans = (ans + mu[i] * (m / i) % mod * inv[m - (m / i)] % mod) % mod;
  printf("%lld\n", (mod - ans + 1) % mod);
  return 0;
}
