#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 2;
  for (int i = 2; i <= n - 1; ++i) {
    ans = 2 * ans % mod;
  }
  long long fac = 1;
  for (int i = 1; i <= n; ++i) {
    fac = fac * i % mod;
  }
  ans = ((fac - ans) % mod + mod) % mod;
  printf("%lld\n", ans);
  return 0;
}
