#include <bits/stdc++.h>
using namespace std;
int N;
long long ans = 0, mod = 1000000007;
long long wx[18];
int top = 1, a[18];
bool v[18], vc[18];
void sou(int x) {
  if (x > N) {
    ans++;
    if (ans >= mod) ans %= mod;
    return;
  }
  for (int i = 1; i <= N; i++)
    if (!v[i] && !vc[(i - 1 + x - 1) % N + 1]) {
      v[i] = 1;
      a[x] = i;
      vc[(i - 1 + x - 1) % N + 1] = 1;
      sou(x + 1);
      v[i] = 0;
      vc[(i - 1 + x - 1) % N + 1] = 0;
    }
}
int main() {
  wx[13] = 695720788;
  wx[15] = 150347555;
  wx[11] = 890786230;
  scanf("%d", &N);
  if (N >= 11) {
    printf("%I64d", wx[N]);
    return 0;
  }
  sou(1);
  ans = ans - 1;
  long long ex = 1;
  for (int i = 2; i <= N; i++) ans = ans * i % mod, ex = ex * i % mod;
  printf("%d", (ans + ex) % mod);
  return 0;
}
