
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type.Int

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
}

fun timesMod(x: Long, y: Long): Long {
  return x * y % P
}

fun plusMod(x: Long, y: Long): Long {
  return (x + y) % P
}

fun minusMod(x: Long, y: Long): Long {
  return (x - y + P) % P
}

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val factorialTable = LongArray(n)
  factorialTable[0] = 1
  for (k in 1..(n - 1)) {
    factorialTable[k] = (factorialTable[k - 1] * k) % P
  }
  val inverseFactorialTable = factorialTable.map { inverseMod(it, P) }.toLongArray()

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

  var ans = 0L
  for (k in 1..(n - 1)) {
    val count = minusMod(fTable[k], fTable[k - 1])
    ans = plusMod(ans, timesMod(count, k.toLong()))
  }
  println(ans)
}