# 2016.2.12 N = input() alpha = [0 for i in range(0, N)] beta = [0 for i in range(0, N)] alpha[0] = 4 alpha[1] = 2 beta[0] = 4 beta[1] = 2 if N < 3: print "0" else: for i in xrange(3, N): beta[0] += alpha[0] beta[1] += alpha[0] * (i - 1) for j in xrange(1, i-1): tmp = alpha[j] beta[j-1] += tmp * j beta[j] += tmp beta[j+1] += tmp * (i - 1 - j) alpha = [be for be in beta[0:N]] print alpha[0] % 1000000007