#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void solve();
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
  return 0;
}
long long f[1000010];
long long get(long long x, long long k) {
  if (k == 0) return 1;
  if (k % 2 == 0) {
    long long ans = get(x, k / 2);
    return (ans * ans) % mod;
  } else {
    return (x * get(x, k - 1)) % mod;
  }
}
void solve() {
  long long n;
  cin >> n;
  f[0] = 1;
  for (long long i = 1; i <= n; i++) {
    f[i] = (f[i - 1] * i) % mod;
  }
  long long ans = 0;
  for (long long i = 0; i <= n; i++) {
    ans = (ans + f[n] * get((f[i] * f[n - i]) % mod, mod - 2)) % mod;
  }
  cout << (mod * 2 + f[n] - (ans * get(2, mod - 2)) % mod) % mod << '\n';
}
