const val P = 1000000007L

// Find (x, y, r) such that r = gcd(a,b) and ax + by = r.
fun extendedGCD(a: Long, b: Long): Triple<Long, Long, Long> {
  var x0 = 1L
  var y0 = 0L
  var z0 = a
  var x1 = 0L
  var y1 = 1L
  var z1 = b
  while (true) {
    if (z1 == 0L) return Triple(x0, y0, z0)
    val q = z0 / z1
    val x2 = x0 - q * x1
    val y2 = y0 - q * y1
    val z2 = z0 - q * z1
    x0 = x1
    x1 = x2
    y0 = y1
    y1 = y2
    z0 = z1
    z1 = z2
  }
}

fun inverseMod(a: Long, m: Long): Long {
  val (x, y, r) = extendedGCD(a, m)
  if (r != 1L) return 0  // No inverse.

  return (x + m) % m
}

class FiniteField(xRaw: Long) {
  val x = if (xRaw >= 0) xRaw % P else (P - ((-xRaw) % P)) % P
  constructor(xi: Int): this(xi.toLong())
  operator fun plus(o: Long) = FiniteField((x + o) % P)
  operator fun plus(o: FiniteField) = this + o.x
  operator fun minus(o: Long) = FiniteField((x + P - o) % P)
  operator fun minus(o: FiniteField) = this - o.x
  operator fun times(o: Long) = FiniteField((x * o) % P)
  operator fun times(o: FiniteField) = this * o.x
  operator fun div(o: Long) = this * inverseMod(o, P)
  operator fun div(o: FiniteField) = this / o.x
  override fun toString() = x.toString()
}

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val factorialTable = Array(n, { FiniteField(0L) })
  factorialTable[0] = FiniteField(1)
  for (k in 1..(n - 1)) {
    factorialTable[k] = factorialTable[k - 1] * k.toLong()
  }

  val fTable = Array(n, { k ->
    if (2 * k < n) FiniteField(0)
    else factorialTable[k] * factorialTable[k - 1] / factorialTable[2 * k - n]
  })

  var ans = FiniteField(0)
  for (k in 1..(n - 1)) {
    val count = fTable[k] - fTable[k - 1]
    ans += count * k.toLong()
  }
  println(ans)
}