#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
inline bool mina(A &first, B second) {
  return (first > second) ? (first = second, 1) : 0;
}
template <class A, class B>
inline bool maxa(A &first, B second) {
  return (first < second) ? (first = second, 1) : 0;
}
template <typename Int, Int mod>
class ModInt {
 public:
  static const Int Mod = mod;
  Int first;
  ModInt() { first = 0; }
  ModInt(int a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  ModInt(long long a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  Int get() const { return first; }
  ModInt &operator+=(ModInt that) {
    if ((first += that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator-=(ModInt that) {
    if ((first += mod - that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator*=(ModInt that) {
    first = (long long)(first)*that.first % mod;
    return *this;
  }
  bool operator==(ModInt that) const { return first == that.first; }
  ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
  ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
  ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
  ModInt operator-() const { return ModInt(-this->first); }
  inline friend ostream &operator<<(ostream &out, ModInt m) {
    return out << m.first;
  }
  ModInt power(long long k) const {
    ModInt r(1);
    ModInt b = *this;
    if (k <= 0) return r;
    while (k) {
      if (k & 1) r *= b;
      b *= b;
      k >>= 1;
    }
    return r;
  }
  ModInt inverse() const {
    long long a = first, b = mod, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    return ModInt(u);
  }
};
const int MAXN = 100005;
int N;
map<int, ModInt<int, (1000000007)> > mem;
ModInt<int, (1000000007)> one_over_n;
int iter;
vector<int> divisors[MAXN];
int vv[MAXN];
ModInt<int, (1000000007)> solve(int cur_gcd) {
  iter++;
  if (cur_gcd == 1) return ModInt<int, (1000000007)>(0);
  if (mem.count(cur_gcd)) return mem[cur_gcd];
  ModInt<int, (1000000007)> ret = 1;
  ModInt<int, (1000000007)> sum_p;
  ModInt<int, (1000000007)> ss;
  for (int i = ((int)(divisors[cur_gcd]).size()) - 1; i >= 0; i--) {
    int nx = divisors[cur_gcd][i];
    int cnt = N / nx;
    for (int j = i + 1; j < ((int)(divisors[cur_gcd]).size()); j++) {
      if (divisors[cur_gcd][j] % nx == 0) {
        cnt -= vv[j];
      }
    }
    vv[i] = cnt;
    ModInt<int, (1000000007)> p = ModInt<int, (1000000007)>(cnt) * one_over_n;
    sum_p += p;
    if (nx != cur_gcd) {
      ret += solve(nx) * p;
    } else {
      ss = p;
    }
  }
  ss = ModInt<int, (1000000007)>(1) - ss;
  ss = ss.inverse();
  return mem[cur_gcd] = ret * ss;
}
int main() {
  for (int i = 2; i < MAXN; i++) {
    for (int j = i; j < MAXN; j += i) {
      divisors[j].push_back(i);
    }
  }
  cin >> N;
  one_over_n =
      ModInt<int, (1000000007)>(1) * ModInt<int, (1000000007)>(N).inverse();
  ModInt<int, (1000000007)> ans = 1;
  for (int i = 1; i <= N; i++) {
    ans += solve(i) * one_over_n;
  }
  cout << ans.get() << endl;
  return 0;
}
