#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1, M = 1e9 + 7;
int n, inv[N], dp[N], ans, freq[N];
vector<int> v[N];
int power(int base, int to) {
  int ret = 1;
  while (to) {
    if (to & 1) ret = ret * 1LL * base % M;
    to >>= 1;
    base = base * 1LL * base % M;
  }
  return ret;
}
void add(int &a, int b) {
  a += b;
  if (a < 0) a += M;
  if (a >= M) a -= M;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i <= n; i++) inv[i] = power(i, M - 2);
  for (int i = 2; i <= n; i++)
    for (int j = i; j <= n; j += i) v[j].push_back(i);
  for (int i = 2; i <= n; i++) {
    for (auto j : v[i]) freq[j] = n / j;
    int good = 0;
    good += freq[i];
    for (int j = (int)v[i].size() - 1; j > -1; j--)
      for (auto k : v[v[i][j]])
        if (k != v[i][j]) freq[k] -= freq[v[i][j]];
    for (auto j : v[i])
      if (j != i) {
        add(dp[i], freq[j] * (dp[j] + 1LL) % M);
        good += freq[j];
      }
    add(dp[i], n - good);
    add(dp[i], freq[i]);
    dp[i] = dp[i] * 1LL * inv[n - freq[i]] % M;
  }
  for (int i = 1; i <= n; i++) add(ans, inv[n] * (dp[i] + 1LL) % M);
  printf("%d\n", ans);
}
