def main(): N = int(input()) MOD = 10**9 + 7 DP = [[[[0]*2 for ft in range(2)] for _ in range(i)] for i in range(N+1)] DP[1][0][False][False] = 1 DP[2][0][False][False] = 2 for i in range(2, N): for j in range(i): for k in [True, False]: for s in [True, False]: DP[i][j][k][s] %= MOD if DP[i][j][k][s] == 0: continue DP[i+1][j-1][False][k] += (j-k-s) * DP[i][j][k][s] if k: DP[i+1][j-1][False][False] += DP[i][j][k][s] if s: DP[i+1][j][True][k] += DP[i][j][k][s] DP[i+1][j][False][k] += (i-1-j+s) * DP[i][j][k][s] DP[i+1][j+1][True][k] += (2-s) * DP[i][j][k][s] print(DP[N][0][False][False] % MOD) if __name__ == '__main__': main()