#include <bits/stdc++.h>
using namespace std;
vector<int> mobius(int top) {
  vector<int> prime;
  vector<int> mobius(top, 0);
  vector<int> map(top, 1);
  mobius[1] = 1;
  int i = 2;
  while (i < top) {
    if (map[i]) {
      prime.push_back(i);
      mobius[i] = -1;
    }
    for (int p : prime) {
      if (p * i < top) {
        map[p * i] = 0;
        if (i % p == 0) {
          mobius[p * i] = 0;
          break;
        }
        mobius[p * i] = -mobius[i];
      } else
        break;
    }
    i++;
  }
  return mobius;
}
long long inv(long long a, int p) {
  long long ans = 1;
  int t = p - 2;
  while (t) {
    if (t % 2 == 1) {
      ans = (ans * a) % p;
    }
    a = (a * a) % p;
    t /= 2;
  }
  return ans % p;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  const int mod = 1e9 + 7;
  int n;
  cin >> n;
  vector<int> mob = mobius(n + 1);
  long long ans = 1;
  for (int i = 2; i <= n; i++) {
    int p = n / i;
    ans -= (long long)mob[i] * p * inv(n - p, mod);
    ans = (ans % mod + mod) % mod;
  }
  cout << ans << endl;
  return 0;
}
