#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, M = 1e5 + 1;
vector<int> d[M];
void init() {
  for (int i = 1; i < M; ++i)
    for (int j = 2 * i; j < M; j += i) d[j].push_back(i);
}
long long binpow(long long a, long long s) {
  long long ans = 1;
  while (s) {
    if (s & 1) ans = ans * a % mod;
    a = a * a % mod;
    s >>= 1;
  }
  return ans;
}
long long inv(long long a) { return binpow(a, mod - 2); }
int m;
vector<int> factorize(int a) {
  vector<int> ans;
  for (int i = 2; i * i <= a; ++i) {
    if (a % i == 0) {
      ans.push_back(i);
      do a /= i;
      while (a % i == 0);
    }
  }
  if (a != 1) ans.push_back(a);
  return ans;
}
int rec(vector<int>& v, int num, int pos = 0, int prod = 1) {
  if (pos == v.size()) return num / prod;
  int ans = 0;
  ans += rec(v, num, pos + 1, prod);
  ans += rec(v, num, pos + 1, -prod * v[pos]);
  return ans;
}
int f(int x, int y) {
  int a = x / y;
  vector<int> factors = factorize(a);
  return rec(factors, m / y);
}
long long dp[M];
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cin >> m;
  init();
  dp[1] = 1;
  long long im = inv(m);
  for (int i = 2; i <= m; ++i) {
    dp[i] = 1;
    for (int j : d[i]) dp[i] = (dp[i] + dp[j] * f(i, j) % mod * im) % mod;
    dp[i] = (dp[i] * inv(1 - f(i, i) * im % mod + mod)) % mod;
  }
  long long ans = 0;
  for (int i = 1; i <= m; ++i) ans = (ans + dp[i]) % mod;
  ans = ans * im % mod;
  cout << ans << '\n';
}
