#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const long long mod = 1e9 + 7;
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int n;
int vis[N], prime[N], num, mu[N], inv[N];
void makeMobius(int siz) {
  mu[1] = 1, num = 0;
  for (int i = 2; i <= siz; i++) {
    if (!vis[i]) prime[++num] = i, mu[i] = -1;
    for (int j = 1; j <= num && i * prime[j] <= siz; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j] == 0) {
        mu[i * prime[j]] = 0;
        break;
      } else
        mu[i * prime[j]] = mu[i] * mu[prime[j]];
    }
  }
  inv[1] = 1;
  for (int i = 2; i <= siz; i++) inv[i] = qpow(i, mod - 2);
}
long long calc(long long d) {
  long long y = n / d;
  return y * inv[n - y] % mod;
}
int main() {
  scanf("%d", &n);
  makeMobius(n);
  long long ans = 1;
  for (int d = 2; d <= n; d++) ans = (ans - calc(d) * mu[d] % mod + mod) % mod;
  printf("%lld\n", (ans + mod) % mod);
  return 0;
}
