#include "bits/stdc++.h"
#define ff first
#define ss second
#define szof(_x) ((int) (_x).size())
#define TASK_NAME ""

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const ll INFL = 1e18 + 123;
const double PI = atan2(0, -1);
mt19937 tw(960172);
ll rnd(ll x, ll y) { static uniform_int_distribution<ll> d; return d(tw) % (y - x + 1) + x; }

template<int prime, int phi>
struct mod_int {
  static int const modulo = prime;
  static int const phi_modulo = phi;

  mod_int(int value)
    : value(value)
    , inv_(-1)
  {
    assert(value >= 0 && value < prime);
  }

  mod_int(long long value)
    : value((value % prime + prime) % prime)
    , inv_(-1)
  {}

  mod_int()
    : value(0)
    , inv_(-1)
  {}

  mod_int<prime, phi> &operator+=(mod_int<prime, phi> const &a) {
    value += a.value;
    if (value >= prime) {
      value -= prime;
    }
    inv_ = -1;
    return *this;
  }

  mod_int<prime, phi> &operator-=(mod_int<prime, phi> const &a) {
    value -= a.value;
    if (value < 0) {
      value += prime;
    }
    inv_ = -1;
    return *this;
  }

  mod_int<prime, phi> &operator*=(mod_int<prime, phi> const &a) {
    value = (long long) value * a.value % prime;
    if (inv_ != -1 && a.inv_ != -1) {
      inv_ = (long long) inv_ * a.inv_ % prime;
    } else {
      inv_ = -1;
    }
    return *this;
  }

  mod_int<prime, phi> &operator/=(mod_int<prime, phi> a) {
    assert(a.value != 0);
    value = (long long) value * a.inv().value % prime;
    if (inv_ != -1) {
      inv_ = (long long) inv_ * a.value % prime;
    }
    return *this;
  }

  mod_int<prime, phi> inv() const {
    if (inv_ == -1 && value != 0) {
      inv_ = pow(phi - 1).value;
    }
    return inv_;
  }

  mod_int<prime, phi> pow(long long ind) const {
    int res = 1;
    int a = value;
    for (; ind > 0; ind >>= 1) {
      if (ind & 1) {
        res = (long long) res * a % prime;
      }
      a = (long long) a * a % prime;
    }
    return mod_int<prime, phi>(res);
  }

  explicit operator int() const {
    return value;
  }

  int value;
  mutable int inv_;
};

template<int p, int q> mod_int<p, q> operator+(mod_int<p, q> a, mod_int<p, q> const &b) { return a += b; }
template<int p, int q> mod_int<p, q> operator-(mod_int<p, q> a, mod_int<p, q> const &b) { return a -= b; }
template<int p, int q> mod_int<p, q> operator*(mod_int<p, q> a, mod_int<p, q> const &b) { return a *= b; }
template<int p, int q> mod_int<p, q> operator/(mod_int<p, q> a, mod_int<p, q> const &b) { return a /= b; }
template<int p, int q> bool operator==(mod_int<p, q> const &a, mod_int<p, q> const &b) { return a.value == b.value; };
template<int p, int q> bool operator!=(mod_int<p, q> const &a, mod_int<p, q> const &b) { return a.value != b.value; };
template<int p, int q> ostream &operator<<(ostream &os, mod_int<p, q> const &m) { return os << m.value; }
template<int p, int q> istream &operator>>(istream &is, mod_int<p, q> &m) { m.inv_ = -1; return is >> m.value; }

const int MOD = 1000000007;
typedef mod_int<1000000007, 1000000007 - 1> mint;

vector<mint> factorial;

mint cnk(int n, int k) {
	return factorial[n] / factorial[k] / factorial[n - k];
}


void solve() {
	/*
	for (int q = 2; q < 10; ++q) {
		vector<int> order(q - 1);
		iota(order.begin(), order.end(), 0);

		int sum = 0;
		do {
			vector<int> arr(q);
			for (int i = 0; i < szof(order); ++i) {
				arr[order[i]] = arr[order[i] + 1] = 1;
				if (*min_element(arr.begin(), arr.end()) == 1) {
					sum += i + 1;
					break;
				}
			}
		} while (next_permutation(order.begin(), order.end()));
		cerr << sum << " ";
	}
	*/
	/*
	vector<vector<int>> v = {{1}, {1, 1}};
	for (int i = 0; i < 10; ++i) {
		vector<int> next = v.back();
		for (int j = 0; j < szof(v[szof(v) - 2]); ++j) {
			next[j] += v[szof(v) - 2][j];
		}
		next.insert(next.begin(), 0);
		for (int num : next) {
			cerr << num << " ";
		}
		cerr << endl;
		v.push_back(next);

	}
	*/

	int n;
	cin >> n;

	factorial = {1};

	for (int i = 1; i < n + 10; ++i) {
		factorial.push_back(factorial.back() * mint(i));
	}

	mint ans = 0;
	mint prev = 0;
	for (int i = 1; i <= n; ++i) {
		if (0 <= n - 1 - i && n - i - 1 <= i - 1) {
			mint cur = cnk(n - 1 - (n - 1 - i) - 1, n - 1 - i) * factorial[i] * factorial[n - 1 - i];
			ans += (cur - prev) * mint(i);
			prev = cur;
		}
	}

	cout << ans << "\n";
}

int main() {
	//freopen(TASK_NAME ".in", "r", stdin);
	//freopen(TASK_NAME ".out", "w", stdout);
	cerr << fixed << setprecision(15);
	cout << fixed << setprecision(15);
	ios::sync_with_stdio(false);

	int tests = 1;
	// cin >> tests;
	for (int it = 1; it <= tests; ++it) {
		solve();
	}
	
	#ifdef LOCAL
		cerr << "time: " << clock() << " ms\n";
	#endif
	return 0;
}

Measured memory_bytes: 10604