import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, std.bitmanip; immutable long MOD = 10^^9 + 7; void main() { auto N = readln.chomp.to!int; assert (N < 1000); auto dp = new long[][](N*2+1, N*2+1); dp[0][0] = 1; foreach (i; 0..N*2) { foreach (j; 0..i+1) { int k = i - j; if (k > j) continue; int rest_j = N - j; int rest_k = N - k; if (rest_j > 0) (dp[i+1][j-k+1] += dp[i][j-k] * rest_j % MOD) %= MOD; if (j - k > 0) (dp[i+1][j-k-1] += dp[i][j-k] * rest_k % MOD * (j - k) % MOD) %= MOD; } } dp[N*2][0].writeln; }