#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
vector<long long> inv, fact, invfact;
void mod_build(int n = 101010) {
  fact.resize(n + 1);
  inv.resize(n + 1);
  invfact.resize(n + 1);
  fact[0] = inv[0] = invfact[0] = 1;
  inv[1] = 1;
  for (int i = (int)(0); i < (int)(n); ++i) {
    fact[i + 1] = fact[i] * (i + 1) % mod;
    if (i > 0) inv[i + 1] = mod - inv[mod % (i + 1)] * (mod / (i + 1)) % mod;
    invfact[i + 1] = invfact[i] * inv[i + 1] % mod;
  }
}
long long perm(int n, int k) {
  if (n < 0 || k < 0 || k > n) return 0;
  return fact[n] * invfact[n - k] % mod;
}
long long comb(int n, int k) {
  if (n < 0 || k < 0 || k > n) return 0;
  return (fact[n] * invfact[n - k] % mod) * invfact[k] % mod;
}
long long pow(long long n, long long k) {
  long long ret = 1;
  while (k) {
    if (k & 1) ret = ret * n % mod;
    n = n * n % mod;
    k >>= 1;
  }
  return ret;
}
int main() {
  int m;
  cin >> m;
  mod_build();
  vector<int> meb(101010, -1), isprime(101010, 1);
  meb[0] = meb[1] = 0;
  isprime[0] = isprime[1] = 0;
  for (int i = (int)(0); i < (int)(m + 1); ++i) {
    if (!isprime[i]) continue;
    for (int j = 2; j * i <= m; j++) {
      isprime[i * j] = false;
    }
    for (int j = 1; j * i <= m; j++) {
      meb[i * j] *= -1;
      if (j % i == 0) meb[i * j] = 0;
    }
  }
  long long ans = 1;
  for (int i = (int)(2); i < (int)(m + 1); ++i) {
    int k = m / i;
    long long res = k * inv[m - k] % mod;
    if (meb[i] == 1)
      ans += res;
    else if (meb[i] == -1)
      ans += mod - res;
  }
  cout << ans % mod << endl;
  return 0;
}
