#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200;
const int INF = 1e9;
const int MOD = 1e9 + 7;
long long ans = 1, power = 1;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    ans *= i;
    power *= 2;
    ans %= MOD;
    power %= MOD;
  }
  ans = (ans * n) % MOD;
  ans = (ans - power);
  while (ans < 0) ans += MOD;
  cout << ans;
  return 0;
}
