#include <bits/stdc++.h>
#define int long long int
#define MOD(x) ((x % MOD_N) + MOD_N) % MOD_N
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RFORE(i,a,b) for(int i=(b);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define RALL(c) (c).rbegin(),(c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SIZE(c) (int)((c).size())
#define EACH(i,v) for(auto i=v.begin();i!=v.end();++i)
#define REACH(i,v) for(auto i=v.rbegin();i!=v.rend();++i)
#define LB(c,x) distance((c).begin(),lower_bound(ALL(c),x))
#define UB(c,x) distance((c).begin(),upper_bound(ALL(c),x))
#define COUNT(c,x) (upper_bound(ALL(c),x)-lower_bound(ALL(c),x))
#define UNIQUE(c) SORT(c); (c).erase(unique(ALL(c)),(c).end());
#define COPY(c1,c2) copy(ALL(c1),(c2).begin())
#define EXIST(s,e) (bool)((s).find(e)!=(s).end())
#define PB push_back
#define MP make_pair
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;
#define NL cerr<<endl;
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T sum(vector<T>&v){return accumulate(ALL(v),T());}
template<typename T>T sum(vector<T>&v,int a,int b){return accumulate(v.begin()+a,v.begin()+b,T());}
template<typename T>T max(vector<T>&v){return *max_element(ALL(v));}
template<typename T>T min(vector<T>&v){return *min_element(ALL(v));}
template<typename T>T max_index(vector<T>&v){return distance((v).begin(),max_element(ALL(v)));}
template<typename T>T min_index(vector<T>&v){return distance((v).begin(),min_element(ALL(v)));}

struct edge { int to, cost; };

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}

const int INF = 1e18;
const int MOD_N = 1e9+7;

struct ModRing {
   int mod, x;
   ModRing(int mod_n) : mod(mod_n), x(0) {}
   ModRing(int a, int mod_n) : mod(mod_n) { x = ((a % mod) + mod) % mod; }

   bool operator==(const ModRing& a) const {
      return x == a.x;
   }
   bool operator==(int a) const {
      return *this == ModRing(a, mod);
   }
   ModRing& operator=(int a) {
      return *this = ModRing(a, mod);
   }
   ModRing operator-() const {
      return ModRing((-x + mod) % mod, mod);
   }
   ModRing& operator+=(const ModRing& a) {
      (x += a.x) %= mod;
      return *this;
   }
   ModRing& operator-=(const ModRing& a) {
      return *this += -a;
   }
   ModRing& operator*=(const ModRing& a) {
      (x *= a.x) %= mod;
      return *this;
   }
   const ModRing operator+(const ModRing& a) const {
      return ModRing(x, mod) += a;
   }
   const ModRing operator-(const ModRing& a) const {
      return ModRing(x, mod) -= a;
   }
   const ModRing operator*(const ModRing& a) const {
      return ModRing(x, mod) *= a;
   }
   ModRing& operator+=(int a) {
      return *this += ModRing(a, mod);
   }
   ModRing& operator-=(int a) {
      return *this -= ModRing(a, mod);
   }
   ModRing& operator*=(int a) {
      return *this *= ModRing(a, mod);
   }
   const ModRing operator+(int a) const {
      return ModRing(x, mod) += a;
   }
   const ModRing operator-(int a) const {
      return ModRing(x, mod) -= a;
   }
   const ModRing operator*(int a) const {
      return ModRing(x, mod) *= a;
   }
   ModRing power(int n) const {
      ModRing tmp(x, mod), res(1, mod);
      while (n > 0) {
         if ((n & 1) == 1) res *= tmp;
         tmp *= tmp;
         n >>= 1;
      }
      return res;
   }
};
auto&operator<<(ostream&s,const ModRing&a){s<<a.x;return s;}

struct FiniteField : ModRing {
   FiniteField(int mod_n) : ModRing(mod_n) {}
   FiniteField(int a, int mod_n) : ModRing(a, mod_n) {}
   FiniteField(const ModRing& a) : ModRing(a) {}

   bool operator==(const FiniteField& a) const {
      return ModRing::operator==(a);
   }
   bool operator==(int a) const {
      return ModRing::operator==(a);
   }
   FiniteField& operator=(int a) {
      return *this = FiniteField(ModRing::operator=(a));
   }
   FiniteField operator-() const {
      return FiniteField(ModRing::operator-());
   }
   FiniteField& operator+=(const FiniteField& a) {
      return *this = FiniteField(ModRing::operator+=(a));
   }
   FiniteField& operator-=(const FiniteField& a) {
      return *this = FiniteField(ModRing::operator-=(a));
   }
   FiniteField& operator*=(const FiniteField& a) {
      return *this = FiniteField(ModRing::operator*=(a));
   }
   const FiniteField operator+(const FiniteField& a) const {
      return FiniteField(ModRing::operator+(a));
   }
   const FiniteField operator-(const FiniteField& a) const {
      return FiniteField(ModRing::operator-(a));
   }
   const FiniteField operator*(const FiniteField& a) const {
      return FiniteField(ModRing::operator*(a));
   }
   FiniteField& operator+=(int a) {
      return *this = FiniteField(ModRing::operator+=(a));
   }
   FiniteField& operator-=(int a) {
      return *this = FiniteField(ModRing::operator-=(a));
   }
   FiniteField& operator*=(int a) {
      return *this = FiniteField(ModRing::operator*=(a));
   }
   const FiniteField operator+(int a) const {
      return FiniteField(ModRing::operator+(a));
   }
   const FiniteField operator-(int a) const {
      return FiniteField(ModRing::operator-(a));
   }
   const FiniteField operator*(int a) const {
      return FiniteField(ModRing::operator*(a));
   }
   FiniteField power(int n) const {
      return FiniteField(ModRing::power(n));
   }

   FiniteField inverse() const {
      try { if (x == 0) throw "0 have no inverse"; }
      catch (const char* e) { cerr << e << endl; }
      return power(mod-2);
   }
   FiniteField& operator/=(const FiniteField& a) {
      return *this *= a.inverse();
   }
   const FiniteField operator/(const FiniteField& a) const {
      return FiniteField(x, mod) /= a;
   }
   FiniteField& operator/=(int a) {
      return *this /= FiniteField(a, mod);
   }
   const FiniteField operator/(int a) const {
      return FiniteField(x, mod) /= a;
   }
};

int GF_MOD = MOD_N;
struct GF : FiniteField {
   GF() : FiniteField(GF_MOD) {}
   GF(int a) : FiniteField(a, GF_MOD) {}
   GF(const FiniteField& a) : FiniteField(a) {}
};

vector<GF> frac;
void init_frac(int N) {
   frac.resize(N+1);
   frac[0] = 1;
   for (int i = 1; i <= N; i++) {
      frac[i] = frac[i-1] * i;
   }
}
GF C(int n, int r) {
   if (n < 0 || n-r < 0 || r < 0) {
      return 0;
   }
   return frac[n] / (frac[n-r] * frac[r]);;
}

signed main()
{
   int n; cin >> n;

   init_frac(n-1);
   V<GF> num(n);
   FORE(k, 1, n-1) {
      num[k] = C(k-1, n-1-k) * frac[k] * frac[n-1-k];
   }
   GF ans = 0;
   FORE(k, 1, n-1) {
      ans += (num[k] - num[k-1]) * k;
   }
   cout << ans << endl;

   return 0;
}

Measured memory_bytes: 31488