#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const long long mod = 1e9 + 7;
long long ans[N];
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long inv(long long x) { return qpow(x, mod - 2); }
int main() {
  long long n;
  cin >> n;
  long long dans = 1;
  for (int i = n; i >= 2; --i) {
    ans[i] = (inv((1 - n / i * inv(n) + mod) % mod) - 1 + mod) % mod;
    for (long long j = i + i; j <= n; j += i) {
      ans[i] = (ans[i] - ans[j] + mod) % mod;
    }
    dans = (dans + ans[i]) % mod;
  }
  cout << dans;
  return 0;
}
