import std.algorithm; import std.array; import std.conv; import std.math; import std.stdio; import std.string; import std.range; int readint() { return readln.chomp.to!int; } int[] readints() { return readln.split.map!(to!int).array; } ulong calc(int n) { if (n == 1) return 1; const mod = 1_000_000_007; ulong sumOdd = 1; ulong sumEven = 0; ulong an = 0; for (int i = 2; i <= n; i++) { if (i % 2 == 0) { ulong ai = (i * sumOdd) % mod; sumEven += ai; an = ai; } else { ulong ai = (i * sumEven) % mod; sumOdd += ai; an = ai; } } return an; } void main() { int n = readint(); writeln(calc(n)); }