#include <bits/stdc++.h>
using namespace std;
using INT = long long;
const int mod = 1e9 + 7;
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int flag[100100], mb[100100], rev[100100];
vector<int> vec[100100];
void pre() {
  mb[1] = 1;
  for (int i = 2; i < 100100; i++) {
    if (flag[i]) continue;
    for (int j = i; j < 100100; j += i) flag[j] = i;
  }
  for (int i = 2; i < 100100; i++) {
    int p = flag[i];
    if ((i / p) % p == 0)
      mb[i] = 0;
    else
      mb[i] = -mb[i / p];
  }
  for (int i = 1; i < 100100; i++) rev[i] = power(i, mod - 2, mod);
  for (int i = 1; i < 100100; i++)
    for (int j = 2 * i; j < 100100; j += i) vec[j].push_back(i);
}
int calc(int n, int x) {
  vector<int> vec;
  while (x > 1) {
    int p = flag[x];
    vec.push_back(p);
    while (x % p == 0) x /= p;
  }
  int ans = 0;
  int nn = vec.size();
  int mx = (1 << nn);
  for (int i = 0; i < mx; i++) {
    int y = 1;
    for (int j = 0; j < nn; j++)
      if ((i & (1 << j))) y *= vec[j];
    int op = __builtin_popcount(i);
    if (op & 1)
      op = -1;
    else
      op = 1;
    ans += op * (n / y);
  }
  return ans;
}
int dp[100100];
int main() {
  pre();
  int m;
  cin >> m;
  if (m == 1) return puts("1"), 0;
  int ans = 0;
  dp[1] = 1;
  for (int i = 2; i <= m; i++) {
    int r = m - (m / i);
    int sum = 0;
    for (int d : vec[i]) {
      sum = (sum + (INT)dp[d] * calc(m / d, i / d)) % mod;
    }
    dp[i] = (INT)(sum + m) * rev[r] % mod;
  }
  for (int i = 1; i <= m; i++) ans = (ans + dp[i]) % mod;
  ans = (INT)ans * rev[m] % mod;
  cout << ans << endl;
  return 0;
}
