#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, f = 1, p = 1, a = 0;
  cin >> n;
  for (i = 1; i < n; i++) {
    f = f * i;
    f = f % 1000000007;
    p = p * 2;
    p = p % 1000000007;
  }
  f = f * n;
  a = a + f;
  a = a % 1000000007;
  a = a - p;
  a = a % 1000000007;
  if (a < 0) a = a + 1000000007;
  cout << a << "\n";
  return 0;
}
