#include <bits/stdc++.h>
using namespace std;
namespace FGF {
int n, m;
const int mo = 1e9 + 7;
const int N = 1e5 + 5;
bool vis[N];
int cnt;
vector<int> fac[N];
long long mu[N], p[N], f[N], ans, inv[N];
void init() {
  mu[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (!vis[i]) p[++cnt] = i, mu[i] = mo - 1;
    for (int j = 1; j <= cnt && p[j] * i <= n; j++) {
      vis[p[j] * i] = 1;
      if (i % p[j] == 0) {
        mu[i * p[j]] = 0;
        break;
      }
      mu[i * p[j]] = mo - mu[i];
    }
  }
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j += i) fac[j].push_back(i);
  inv[1] = 1;
  for (int i = 2; i <= n; i++) inv[i] = inv[mo % i] * (mo - mo / i) % mo;
}
void work() {
  scanf("%d", &n);
  init();
  for (int i = 2; i <= n; i++) {
    for (int sz = fac[i].size(), j = 0; j < sz; j++) {
      int d = fac[i][j];
      if (d == i) continue;
      long long sum = 0;
      for (int s = fac[i / d].size(), k = 0; k < s; k++)
        sum = (sum + mu[fac[i / d][k]] * (n / d / fac[i / d][k]) % mo) % mo;
      f[i] = (f[i] + sum * f[d] % mo) % mo;
    }
    f[i] = (f[i] + n) * inv[n - n / i] % mo;
    ans = (ans + f[i]) % mo;
  }
  printf("%lld", (ans * inv[n] % mo + 1) % mo);
}
}  // namespace FGF
int main() {
  FGF::work();
  return 0;
}
