package atcoder

object Main {
  val mod: Int = 1e9.toInt + 7
  def pow(a: Int, b: Int): Int = b match {
    case 0 => 1
    case _ =>
      val tmp = pow(a, b / 2).toLong
      if (b % 2 == 0) (tmp * tmp % mod).toInt
      else (tmp * tmp % mod * a % mod).toInt
  }
  def inv(a: Int): Int = pow(a, mod - 2)

  def main(args: Array[String]): Unit = {
    val n = io.Source.stdin.bufferedReader().readLine().toInt
    val fact = Range(1, n).scanLeft(1)((x, y) => (x.toLong * y % mod).toInt)
    val ifact = fact.map(inv)
    val f = Range(0, n).map { k =>
      if (2 * k - n < 0) 0
      else (fact(k-1).toLong * fact(k) % mod * ifact(2*k - n) % mod).toInt
    }
    val answer = Range(1, n)
      .map(i => (f(i) - f(i - 1) + mod).toLong * i % mod)
      .reduce((x, y) => (x + y) % mod)
    println(answer)
  }
}
