#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, P = 1e9 + 7;
int m, cnt[N], ans;
bool mark[N];
int power(int a, int b) {
  return b ? 1LL * power(1LL * a * a % P, b / 2) * (b & 1 ? a : 1) % P : 1;
}
inline int solve(int x) {
  x = 1LL * m * power(m - m / x, P - 2) % P;
  return (x - power(x, P - 2) + P) % P;
}
int main() {
  cin >> m;
  mark[1] = true;
  ans = power(m, P - 2);
  for (int i = 2; i <= m; i++) {
    if (!cnt[i])
      for (int j = m - m % i; j; j -= i) {
        mark[j] = mark[j / i];
        cnt[j]++;
      }
    if (mark[i]) (ans += (cnt[i] & 1 ? solve(i) : P - solve(i))) %= P;
  }
  cout << ans;
}
