#include <bits/stdc++.h>
using namespace std;
long long pow2(long long a, long long b, long long m) {
  long long ans = 1;
  while (b > 0) {
    if (b & 1) {
      ans = (ans * a) % m;
    }
    a = (a * a) % m;
    b >>= 1;
  }
  return ans;
}
long long inv(long long a, long long b) {
  return 1 < a ? b - inv(b % a, a) * b / a : 1;
}
long long* fact = new long long[1000005]{0};
void solve() {
  long long n;
  cin >> n;
  long long ans = fact[n];
  long long mul = fact[n - 1];
  for (long long i = 2; i < n; i++) {
    long long c = (inv(fact[i - 1], 1000000007) * mul) % 1000000007;
    c = (c * inv(fact[n - i], 1000000007)) % 1000000007;
    ans = (ans - (c) % 1000000007 + 1000000007) % 1000000007;
  }
  cout << ans - 2 << "\n";
}
int32_t main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  fact[0] = fact[1] = 1;
  for (long long i = 2; i < 1000002; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
  }
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
