#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
const int MOD = 1000000000 + 7;
long long dp[MAXN]{0};
vector<int> fact[MAXN];
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
long long fastpow(int a, int x) {
  long long r = a;
  long long ans = 1;
  while (x) {
    if (x & 1) {
      ans *= r;
      ans %= MOD;
    }
    r *= r;
    r %= MOD;
    x >>= 1;
  }
  return ans;
}
int main() {
  int m;
  cin >> m;
  for (int i = 2; i <= m; i++) {
    for (int j = i; j <= m; j += i) {
      fact[j].push_back(i);
    }
  }
  dp[1] = 0;
  for (int i = 2; i <= m; i++) {
    long long sum = 0;
    int cnt = m / i;
    int stat[150]{0};
    stat[fact[i].size() - 1] = cnt;
    for (int j = fact[i].size() - 2; j >= 0; j--) {
      stat[j] = m / fact[i][j];
      for (int k = j + 1; k < fact[i].size(); k++) {
        if (!(fact[i][k] % fact[i][j])) {
          stat[j] -= stat[k];
        }
      }
    }
    for (int j = fact[i].size() - 2; j >= 0; j--) {
      sum += stat[j] * dp[fact[i][j]];
    }
    dp[i] = (m + sum) % MOD * fastpow(m - cnt, MOD - 2) % MOD;
  }
  long long ret = 1;
  for (int i = 1; i <= m; i++) {
    ret += (dp[i]) * fastpow(m, MOD - 2) % MOD;
    ret %= MOD;
  }
  cout << ret << endl;
  return 0;
}
