import java.io.*; import java.util.*; public class Main_yukicoder554 { private static Scanner sc; private static Printer pr; private static void solve() { final int MOD = 1_000_000_007; int n = sc.nextInt(); long[] a = new long[n + 2]; long[] sum = new long[n + 2]; a[1] = 1; sum[1] = 1; a[2] = 2; sum[2] = 2; for (int i = 3; i <= n; i++) { a[i] = sum[i - 1] * i % MOD; sum[i] = sum[i - 2] + a[i]; sum[i] %= MOD; } pr.println(a[n]); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }