#include <bits/stdc++.h>
using namespace std;
struct Node {
  long long x, y, z;
  Node friend operator+(Node x, Node y) {
    Node z;
    z.y = (x.y * y.y) % 1000000007;
    z.x = (x.x * y.z + y.x * x.z) % 1000000007;
    z.z = (x.z * y.z) % 1000000007;
    return z;
  }
} ans[100005], e, gg;
vector<int> pri[100005][2];
vector<int> wtf[100005], now;
long long ksm(long long x, long long y) {
  long long z = 1;
  while (y) {
    if (y % 2) z = (x * z) % 1000000007;
    x = (x * x) % 1000000007;
    y = y / 2;
  }
  return z;
}
void dfs(int i, int x, int y) {
  if (y == now.size()) {
    wtf[i].push_back(x);
    return;
  }
  dfs(i, x * (-now[y]), y + 1);
  dfs(i, x, y + 1);
}
int ask(int x, int y) {
  int ans = 0;
  for (int i = 0; i < wtf[x].size(); i++) {
    if (wtf[x][i] > 0)
      ans += y / wtf[x][i];
    else
      ans -= y / (-wtf[x][i]);
  }
  return ans;
}
int main() {
  int m;
  scanf("%d", &m);
  ans[0].y = 1;
  ans[0].x = m;
  ans[0].z = 1;
  ans[1].y = 1;
  ans[1].x = 0;
  ans[1].z = 1;
  wtf[1].push_back(1);
  for (int i = 2; i <= m; i++) {
    int tt = i;
    now.clear();
    for (int j = 2; j * j <= tt; j++) {
      if (tt % j == 0) {
        now.push_back(j);
        while (tt % j == 0) tt = tt / j;
      }
    }
    if (tt != 1) now.push_back(tt);
    dfs(i, 1, 0);
  }
  for (int i = 2; i <= m; i++) {
    ans[i].y = 1;
    ans[i].x = m;
    ans[i].z = 1;
    for (int j = 2; j * j <= i; j++) {
      if (i % j == 0) {
        gg = ans[j];
        gg.x = (gg.x * ask(i / j, m / j)) % 1000000007;
        ans[i] = ans[i] + gg;
        if (j * j != i) {
          gg = ans[i / j];
          gg.x = (gg.x * ask(j, m / (i / j))) % 1000000007;
          ans[i] = ans[i] + gg;
        }
      }
    }
    ans[i].y = (ans[i].y * ksm(m - m / i, 1000000007 - 2)) % 1000000007;
    ans[i].z = (ans[i].z * (m - m / i)) % 1000000007;
    ans[0] = ans[0] + ans[i];
  }
  ans[0].y = (ans[0].y * ksm(m, 1000000007 - 2)) % 1000000007;
  printf("%lld\n", (ans[0].x * ans[0].y) % 1000000007);
  return 0;
}
