#include<cstdio>
#include<algorithm>
#define rep(i,l,r) for (int i=(l); i<=(r); i++)
using namespace std;

const int N=510,mod=1e9+7;
int n,C[N][N],f[N][N];

int dfs(int n,int x){
	if (!n) return!x;
	int &g=f[n][x];
	if (g) return g-1;
	for (int y=x?x:x+2; y<=n; y+=2){
		int s=0;
		rep(z,0,y) s=(s+1ll*C[y][z]*dfs(n-y,abs((x+z*2-y)/2)))%mod;
		g=(g+1ll*C[n][y]*s)%mod;
	}
	return g++;
}

int main(){
	scanf("%d",&n);
	rep(i,0,n) for(int j=C[i][0]=1;j<=i;j++) C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
	int ans=1ll*(dfs(n-1,0)+dfs(n-1,1))*n%mod;
	printf("%d\n",ans);
	return 0;
}