#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7, M = 1e9 + 7;
long long power(long long a, long long p) {
  if (p == 0) return 1;
  long long ans = power(a, p / 2);
  ans = (ans * ans) % M;
  if (p % 2) ans = (ans * a) % M;
  return ans;
}
int mu[N];
void sieve() {
  for (int i = 2; i < N; i++)
    if (mu[i] == 0)
      for (int j = i; j < N; j += i) mu[j]++;
  for (int i = 1; i < N; i++)
    if (mu[i] % 2)
      mu[i] = -1;
    else
      mu[i] = 1;
  for (int i = 2; i * i < N; i++)
    for (int j = i * i; j < N; j += i * i) mu[j] = 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  sieve();
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 2; i <= n; i++) {
    long long prob = ((n / i) * power(n, M - 2)) % M;
    long long z = power(M + 1 - prob, M - 2) - 1;
    ans = (ans - mu[i] * z) % M;
  }
  ans = (ans % M + M + 1) % M;
  cout << ans << endl;
}
