import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long MOD = (long)Math.pow(10, 9) + 7; long[] dp = new long[(int)n + 1]; long[] oddsum = new long[(int)n + 1]; long[] evensum = new long[(int)n + 1]; dp[1] = 1; oddsum[1] = 1; evensum[1] = 0; dp[2] = 2; oddsum[2] = 0; evensum[2] = 2; for(int i = 3; i < n + 1; i++) { if(i % 2 == 0) { dp[i] = (i * oddsum[i - 1]) % MOD; oddsum[i] = 0; evensum[i] = (evensum[i - 2] + i) % MOD; } else { dp[i] = (i * evensum[i - 1]) % MOD; oddsum[i] = (oddsum[i - 2] + i) % MOD; evensum[i] = 0; } } System.out.println(dp[(int)n]); } }