#include <bits/stdc++.h>
using namespace std;
namespace zyt {
const int N = 1e5 + 10, p = 1e9 + 7;
vector<int> fac[N];
int n, f[N], pcnt, prime[N], mu[N];
bool mark[N];
void init() {
  for (int i = 1; i <= n; i++)
    for (int j = 1; j * j <= i; j++)
      if (i % j == 0) {
        fac[i].push_back(j);
        if (j * j != i) fac[i].push_back(i / j);
      }
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!mark[i]) prime[pcnt++] = i, mu[i] = p - 1;
    for (int j = 0; j < pcnt && (long long)i * prime[j] <= n; j++) {
      int k = i * prime[j];
      mark[k] = true;
      if (i % prime[j] == 0) {
        mu[k] = 0;
        break;
      } else
        mu[k] = p - mu[i];
    }
  }
}
int power(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = (long long)ans * a % p;
    a = (long long)a * a % p;
    b >>= 1;
  }
  return ans;
}
int inv(const int a) { return power(a, p - 2); }
int work() {
  scanf("%d", &n);
  init();
  f[1] = 0;
  int ans = 0;
  for (int i = 2; i <= n; i++) {
    for (int j = 0; j < fac[i].size(); j++) {
      int d = fac[i][j];
      if (d == i) continue;
      int tmp = 0;
      for (int k = 0, size = fac[i / d].size(); k < size; k++) {
        int t = fac[i / d][k];
        tmp = (tmp + (long long)mu[t] * (n / d / t) % p) % p;
      }
      f[i] = (f[i] + (long long)tmp * f[d] % p) % p;
    }
    f[i] = (long long)(f[i] + n) * inv(n - n / i) % p;
  }
  for (int i = 1; i <= n; i++) ans = (ans + f[i]) % p;
  printf("%d", int(((long long)ans * inv(n) % p) + 1) % p);
  return 0;
}
}  // namespace zyt
int main() { return zyt::work(); }
