#include <iostream>
using namespace std;
const int N = 1010;
typedef long long ll;
const ll MOD = 1e9 + 7;
ll C[N][N];
int main(){
int n; cin >> n;
for(int i = 0; i < N; i ++ )
for(int j = 0; j <= i; j ++ )
if(j == 0) C[i][j] = 1;
else C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % MOD;
ll res = 0;
for(int k = 2; k <= n - 2; k ++ )
res = (res + C[n - 1][k] * (k - 1) * (n - k - 1)) % MOD;
cout << res << endl;
return 0;
}