const MOD = 10**9+7
const mul = (a,b) => ((a>>16)*b%MOD*65536+(a&65535)*b)%MOD;

const mpow = (x, n) => {
    ans = 1;
    let _x = x
    while(n != 0){
        if(n & 1) ans = mul(ans,_x);
        _x = mul(_x,_x);
        n = n >> 1;
    }
    return ans;
}


const main = (arg) => {
  	let n = Number(arg)
  	
  	if(n===1) {
  	    console.log(0)
  	} else {
  	    let ans = 1;
      	for(let i=1; i<=n; i++) {
      	 ans *= i
      	 ans %= MOD
      	}
      	if(n>=3) {
          	ans = mul(ans,mpow(8,n-2))
          	ans %= MOD
          	ans += (mpow(2,n)-2)
      	}
      	console.log(ans)
  	}    

}

main(require("fs").readFileSync("/dev/stdin", "utf8"));