#include <bits/stdc++.h>
using std::bitset;
using std::cin;
using std::cout;
using std::endl;
using std::make_pair;
using std::map;
using std::pair;
using std::priority_queue;
using std::queue;
using std::set;
using std::string;
using std::stringstream;
using std::vector;
class MyTimer {
 public:
  void reset() {}
  void report() {}
} myTimer;
template <typename A, typename B>
std::ostream &operator<<(std::ostream &cout, const pair<A, B> &x) {
  return cout << "(" << x.first << ", " << x.second << ")";
}
template <typename T1, typename T2>
inline bool chmin(T1 &a, const T2 &b) {
  return a > b ? a = b, true : false;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, const T2 &b) {
  return a < b ? a = b, true : false;
}
const int maxN = 100000 + 233;
const long long P = 1000000007;
long long qpow(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) (r *= a) %= P;
    (a *= a) %= P;
    b >>= 1;
  }
  return r;
}
long long inv(long long a) { return qpow(a, P - 2); }
int n;
long long c[maxN];
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  memset(c, 0, sizeof(c));
  c[1] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = i + i; j <= n; j += i) c[j] -= c[i];
  };
  ;
  long long in = qpow(n, P - 2);
  long long ans = 0;
  for (int i = 2; i <= n; ++i) {
    long long a = (n / i) * in % P;
    (ans +=
     c[i] *
     ((inv(1 - a) * inv(1 - a) % P * a % P - a) * (1 - inv(a)) % P + a)) %= P;
  }
  ans += 1;
  ans %= P;
  ans += P;
  ans %= P;
  cout << ans << endl;
  return 0;
}
