#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
const long long N = 2e5 + 10;
inline long long add(long long x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
  return x;
}
inline long long mul(long long x, long long y) {
  x = (1LL * x * y) % mod;
  return x;
}
inline long long pow_(long long x, long long y, long long p = mod) {
  long long r = 1;
  while (y) {
    if (y & 1) r = r * x % p;
    y >>= 1;
    x = x * x % p;
  }
  return r;
}
inline long long inv_(long long x) { return pow_(x, mod - 2, mod); }
long long dp[N];
vector<long long> divi[N];
long long spf[N];
void divisors() {
  for (long long i = 1; i <= 1e5; ++i) {
    for (long long j = i; j <= 1e5; j += i) {
      divi[j].push_back(i);
    }
  }
}
void pre() {
  for (long long i = 1; i <= 1e5; ++i) spf[i] = i;
  for (long long i = 2; i <= 1e5; ++i) {
    if (spf[i] == i) {
      for (long long j = i * i; j <= 1e5; j += i) {
        if (spf[j] == j) spf[j] = i;
      }
    }
  }
}
long long calc(long long a, long long m) {
  vector<long long> primes;
  while (a > 1) {
    long long pp = spf[a];
    primes.push_back(pp);
    while (a % pp == 0 && a > 1) a /= pp;
  }
  long long l = (long long)primes.size();
  long long sum = 0;
  for (long long i = 1; i <= (1LL << l) - 1; ++i) {
    long long ss = __builtin_popcount(i);
    long long s = 1;
    for (long long j = 0; j <= l - 1; ++j) {
      if (i & (1LL << j)) {
        s = s * primes[j];
      }
    }
    if (ss % 2 == 0)
      sum -= m / s;
    else
      sum += m / s;
  };
  return m - sum;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  pre();
  divisors();
  long long m;
  cin >> m;
  dp[1] = 0;
  for (long long i = 2; i <= m; ++i) {
    long long sum = 0;
    long long cc = 0;
    for (long long j = 0; j < (long long)divi[i].size(); j++) {
      long long y = divi[i][j];
      ;
      if (y != i)
        sum = add(sum, mul(dp[y], calc(i / y, m / y)));
      else
        cc = calc(i / y, m / y);
    }
    dp[i] = mul(m + sum, inv_(m - cc));
  }
  long long ans = 0;
  for (long long i = 1; i <= m; ++i) ans = add(ans, dp[i]);
  ans = mul(m + ans, inv_(m));
  cout << ans;
  return 0;
}
