#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &vec) {
  const int n = vec.size();
  out << '[';
  for (int i = 0; i < n; i++) {
    out << vec[i] << (i == n - 1 ? "" : ", ");
  }
  out << ']';
  return out;
}
pair<long long, long long> exgcd(const long long x, const long long y) {
  if (!y) {
    return make_pair(1, 0);
  }
  pair<long long, long long> cur = exgcd(y, x % y);
  return make_pair(cur.second, cur.first - (x / y) * cur.second);
}
const long long __mod__ = 1000000007;
long long mod(long long x, long long p = __mod__) { return ((x % p) + p) % p; }
long long mmod() { return 1ll; }
template <typename T, typename... U>
long long mmod(const T &head, const U &...tail) {
  return mod((head % __mod__) * mmod(tail...), __mod__);
}
void print() {}
template <typename T, typename... U>
void print(const T &head, const U &...tail) {
  cout << head << (sizeof...(tail) ? ' ' : '\n');
  print(tail...);
}
void scan() {}
template <typename T, typename... U>
void scan(T &head, U &...tail) {
  cin >> head;
  scan(tail...);
}
long long fmul(long long a, long long c, const long long &Mod = __mod__) {
  a %= Mod, c %= Mod;
  return (a * c - (long long)(((long double)a * c + 0.5) / Mod) * Mod) % Mod;
}
long long _gcd(const long long x, const long long y) {
  return y == 0 ? x : _gcd(y, x % y);
}
long long gcd() { return 0ll; }
template <typename T, typename... U>
long long gcd(const T &head, const U &...tail) {
  return _gcd(head, gcd(tail...));
}
long long fpow(long long a, long long b, const long long &p = __mod__) {
  long long ans = 1ll;
  for (a %= p; b; a = a * a % p, b >>= 1) {
    if (b & 1) {
      ans = ans * a % p;
    }
  }
  return ans;
}
long long eulur(long long x) {
  long long ans = x;
  for (long long i = 2; i * i <= x; i++) {
    if (x % i == 0) {
      ans -= ans / i;
      while (x % i == 0) {
        x /= i;
      }
    }
  }
  if (x > 1) {
    ans -= ans / x;
  }
  return ans;
}
void solve();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
const int MAXN = 100000 + 50;
bool isnpri[MAXN];
vector<int> pri;
int mu[MAXN];
void mobius() {
  mu[1] = 1;
  for (int i = 2; i < MAXN; i++) {
    if (!isnpri[i]) {
      pri.emplace_back(i);
      mu[i] = -1;
    }
    for (int j = 0; j < int(pri.size()); j++) {
      const int cur = i * pri[j];
      if (cur >= MAXN) {
        break;
      }
      isnpri[cur] = true;
      if (i % pri[j] == 0) {
        mu[cur] = 0;
        break;
      } else {
        mu[cur] = -mu[i];
      }
    }
  }
  for (int i = 2; i < MAXN; i++) {
    mu[i] += mu[i - 1];
  }
}
const long long MOD = 1e9 + 7;
void solve() {
  mobius();
  int n;
  cin >> n;
  long long ans = 1;
  for (int i = 2, j; i <= n; i = j + 1) {
    j = n / (n / i);
    ans =
        mod(ans - mmod(mu[j] - mu[i - 1], n / i, exgcd(n - n / i, MOD).first));
  }
  print(ans);
}
