val mod = 1000000007L

fun exp(base:Long, exponent:Long):Long {
    return when(exponent){
        0L -> 1
        1L -> base
        else -> exp(base, exponent / 2).let{it mul it mul exp(base, exponent % 2)}
    }
}
infix fun Long.div(n:Long):Long {
    return this mul exp(n, mod - 2)
}
infix fun Long.mul(n:Long):Long {
    return this * n % mod
}
infix fun Long.mul(n:Int):Long = this mul n.toLong()
infix fun Long.plus(n:Long):Long{
    return (this + n) % mod
}
infix fun Long.minus(n:Long):Long {
    return (this - n) plus mod
}

fun main(args:Array<String>):Unit{
    val N = readLine()!!.toInt()
    val factorial = Array(N + 1){1L}.apply{
        for (i in 1 .. N){
            this[i] = this[i - 1] mul i
        }
    }
    val divFactorial = factorial.mapIndexed{index, fact -> if (index % 2 == N % 2) exp(fact, mod - 2) else 0L}
    val G = Array(N){
        factorial[N - 1] minus (if (it * 2 >= N) (factorial[it - 1] mul factorial[it] mul divFactorial[2 * it - N]) else 0L)
    }
    println((0 until N - 1).map{G[it]}.fold(0L){a, b -> a plus b})
}