#include <bits/stdc++.h>
#pragma comment(linker, "/stack:256000000")
using namespace std;
mt19937_64 gen(time(NULL));
long long const maxn = 1e5 + 5;
long long const mod = 1e9 + 7;
long long mul(long long a, long long b) {
  a = (a + mod) % mod;
  b = (b + mod) % mod;
  a = a * b;
  a = (a + mod) % mod;
  return a;
}
long long pw(long long a, long long p) {
  if (p == 0)
    return 1;
  else {
    long long kek = pw(a, p / 2);
    if (p % 2) {
      return mul(kek, mul(kek, a));
    } else {
      return mul(kek, kek);
    }
  }
}
long long gcd(long long a, long long b) { return (a == 0 ? b : gcd(b % a, a)); }
long long dp[maxn];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long m;
  cin >> m;
  long long m_1 = pw(m, mod - 2);
  long long ans = 1;
  for (long long i = m; i >= 2; i--) {
    long long q = mul((m / i), m_1);
    dp[i] = mul(q, pw(1 - q, mod - 2));
    for (long long j = i + i; j <= m; j += i) {
      dp[i] -= dp[j];
      dp[i] = (dp[i] + mod) % mod;
    }
    ans = (ans + dp[i]) % mod;
  }
  cout << ans << endl;
  return 0;
}
