#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

template <class T, class U>
inline bool chmin(T &lhs, const U &rhs) {
  if (lhs > rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

template <class T, class U>
inline bool chmax(T &lhs, const U &rhs) {
  if (lhs < rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

// [l, r) from l to r
struct range {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { ++i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr range(int l_, int r_): l(l_), r(std::max(l_, r_)) { }
  constexpr itr begin() const { return l; }
  constexpr itr end() const { return r; }
};

// [l, r) from r to l
struct revrange {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { --i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr revrange(int l_, int r_): l(l_ - 1), r(std::max(l_, r_) - 1) { }
  constexpr itr begin() const { return r; }
  constexpr itr end() const { return l; }
};

template <uint32_t Modulus>
class modular {
public:
  using value_type = uint32_t;
  using max_type = uint64_t;

  static constexpr value_type mod = Modulus;
  static constexpr value_type mod_min = 1;
  static constexpr value_type mod_max = 2147483647;
  static_assert(mod >= mod_min, "invalid mod :: too small");
  static_assert(mod <= mod_max, "invalid mod :: too big");

  template <class T>
  static constexpr value_type normalize(T value_) {
    if (value_ < 0) {
      value_ = -value_;
      value_ %= mod;
      if (value_ == 0) return 0;
      return mod - value_;
    }
    return value_ % mod;
  }

private:
  value_type value;

public:
  constexpr modular(): value(0) { }
  template <class T>
  explicit constexpr modular(T value_): value(normalize(value_)) { }
  template <class T>
  explicit constexpr operator T() { return static_cast<T>(value); }

  constexpr value_type operator () () const { return value; }
  constexpr modular operator - () const { return modular(mod - value); }
  constexpr modular operator ~ () const { return inverse(); }

  constexpr modular inverse() const { return power(mod - 2); }
  constexpr modular power(max_type exp) const {
    modular res(1), mult(*this);
    while (exp > 0) {
      if (exp & 1) res *= mult;
      mult *= mult;
      exp >>= 1;
    }
    return res;
  }

  constexpr modular operator + (const modular &rhs) const { return modular(*this) += rhs; }
  constexpr modular& operator += (const modular &rhs) { 
    if ((value += rhs.value) >= mod) value -= mod; 
    return *this; 
  }

  constexpr modular operator - (const modular &rhs) const { return modular(*this) -= rhs; }
  constexpr modular& operator -= (const modular &rhs) { 
    if ((value += mod - rhs.value) >= mod) value -= mod; 
    return *this; 
  }

  constexpr modular operator * (const modular &rhs) const { return modular(*this) *= rhs; }
  constexpr modular& operator *= (const modular &rhs) { 
    value = (max_type) value * rhs.value % mod;
    return *this;
  }

  constexpr modular operator / (const modular &rhs) const { return modular(*this) /= rhs; }
  constexpr modular& operator /= (const modular &rhs) { return (*this) *= rhs.inverse(); }

  constexpr bool zero() const { return value == 0; }
  constexpr bool operator == (const modular &rhs) const { return value == rhs.value; }
  constexpr bool operator != (const modular &rhs) const { return value != rhs.value; }
  friend std::ostream& operator << (std::ostream &stream, const modular &rhs) {
    return stream << rhs.value;
  }

};

template <class T>
class factorials {
public:
  using value_type = T;

public:
  std::vector<value_type> fact, fact_inv;

  factorials(int size_ = 200000): fact(size_ + 1), fact_inv(size_ + 1) {
    fact[0] = value_type(1);
    for (int i = 1; i <= size_; ++i) {
      fact[i] = fact[i - 1] * value_type(i);
    }
    fact_inv[size_] = ~fact[size_];
    for (int i = size_; i > 0; --i) {
      fact_inv[i - 1] = fact_inv[i] * value_type(i);
    }
  }

  value_type operator () (int n, int r) const {
    return fact[n] * fact_inv[n - r] * fact_inv[r];
  }

};

using modint = modular<1000000007>;
factorials<modint> fact(1000000);

int main() {
  int N;
  std::cin >> N;
  if (N == 2) {
    std::cout << "1\n";
    return 0;
  }
  auto calc = [&](int black, int white) {
    if (black < 0 || white < 0) return modint(0);
    if (white > black + 1) return modint(0);
    return fact(black + 1, white);
  };
  auto expected1 = [&](int black, int white) {
    if (black < 2 || white < 0) return modint(0);
    return modint(black) * modint(black - 1) * fact.fact[black + white - 2] * fact.fact_inv[black + white];
  };
  auto expected2 = [&](int black, int white) {
    if (black < 1 || white < 0) return modint(0);
    return modint(black) * fact.fact[black + white - 1] * fact.fact_inv[black + white];
  };
  modint ans;
  for (int put: range(2, N)) {
    int empty = N - put - 1;
    modint coeff(2 * empty + 2);
    coeff -= modint(put - 2) * expected1(empty, put - empty - 1);
    coeff -= modint(2) * expected2(empty, put - empty - 1);
    ans += coeff * calc(put - 2, empty) * fact.fact[put] * fact.fact[empty];
  }
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 8064