import java.util.Arrays; import java.util.Scanner; public class Main { final long MODULO = 1_000_000_000 + 7; void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long[] a = new long[n + 1]; a[1] = 1; long[][] s = new long[2][n + 1]; s[1][1] = 1; for (int i = 2; i <= n; ++i) { a[i] = i * s[1 - i % 2][i - 1] % MODULO; s[i % 2][i] = s[i % 2][i - 1] + a[i]; s[1 - i % 2][i] = s[1 - i % 2][i - 1]; a[i] %= MODULO; s[i % 2][i] %= MODULO; } System.out.println(a[n]); } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } public static void main(String[] args) { new Main().run(); } }