#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


long long modpow(long long x, long long y)
{
  long long p = 1;

  for ( ; y; (x *= x) %= MOD, y >>= 1)
    if (y & 1)
      (p *= x) %= MOD;

  return p;
}

class modint_t {
  friend std::ostream& operator<<(std::ostream& ofs, const modint_t a);

public:
  modint_t(long long xx = 0) : x(xx % MOD) {};

public:
  bool operator==(long long a) const {
    return x == a;
  };

public:
  long long value() const {
    return x;
  };

public:
  modint_t operator+(const modint_t& a) const {
    return (x + a.x) % MOD;
  };

  modint_t operator-(const modint_t& a) const {
    return (x - a.x) % MOD;
  };

  modint_t operator*(const modint_t& a) const {
    return x * a.x % MOD;
  };

  modint_t operator/(const modint_t& a) const {
    return (*this) * a.inverse();
  };

  // Note that operator^'s priority is quite low in C++...
  modint_t operator^(long long i) const {
    return modint_t(modpow(x, i));
  };

public:
  modint_t& operator+=(const modint_t& a) {
    (x += a.x) %= MOD;

    return *this;
  };

  modint_t& operator-=(const modint_t& a) {
    (x -= a.x) %= MOD;

    return *this;
  };

  modint_t& operator*=(const modint_t& a) {
    (x *= a.x) %= MOD;

    return *this;
  };

  modint_t& operator/=(const modint_t& a) {	// Not tested
    (x *= a.inverse().x) %= MOD;

    return *this;
  };

public:
  modint_t inverse() const {
    assert(x % MOD);

    return modint_t(modpow(x, MOD - 2));
  };

public:
  modint_t normalized() const {
    return modint_t(x % MOD + MOD);
  };

private:
  long long x;
};

modint_t operator-(long long a, const modint_t& b)
{
  return modint_t(a) - b;
}

modint_t operator*(long long a, const modint_t& b)
{
  return modint_t(a) * b;
}

modint_t operator/(long long a, const modint_t& b)
{
  return modint_t(a) / b;
}

std::ostream& operator<<(std::ostream& ofs, const modint_t a)
{
  ofs << a.x;

  return ofs;
}


modint_t memo[1111111], memo2[1111111];


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  memo[0] = memo[1] = 1;
  
  for (int i = 2; i < 1111111; i ++)
    memo[i] = memo[i - 1] * i;

  memo2[0] = memo2[1] = 1;

  for (int i = 2; i < 1111111; i ++)
    memo2[i] = memo2[i - 1] / i;

  int N;
  
  std::cin >> N;

  if (N == 2) {
    std::cout << 1 << std::endl;

    return 0;
  }
  else if (N == 3) {
    std::cout << 4 << std::endl;

    return 0;
  }
  else if (N == 4) {
    std::cout << 16 << std::endl;

    return 0;
  }

  modint_t C = 0, c = 0;

  for (int K = (N + 1) / 2; K < N; K ++) {
    modint_t k = K - 1, l = (N - 2) - k, m = k - l;
    
    modint_t cc = memo[(l + m).value()] * memo2[l.value()] * memo2[m.value()] * memo[K] * memo[N - 1 - K];

    C += (cc - c) * K;

    c = cc;
  }

  std::cout << C.normalized() << std::endl;

  return 0;
}


Measured memory_bytes: 17664