package yukicoder; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solver(); } final long MOD = 1000000007; void solver() { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); long[] c = new long[N + 2]; c[0] = 1; c[1] = 2; c[2] = 1; long[] dp = new long[N + 1];// dp[i]:N=iの時の門松列の数 dp[0] = 1; dp[1] = 1; dp[2] = 2; for (int i = 2; i < N; i++) { for (int j = 0; j <= i; j++) { dp[i + 1] += dp[i - j] / (((i - j) != 0 && (i - j) != 1) ? 2 : 1) * dp[j] / ((j != 0 && j != 1) ? 2 : 1) % MOD * c[j]; dp[i + 1] %= MOD; if(dp[i+1]<0){ throw new AssertionError("error"); } } for (int j = N; j >= 0; j--) { if (j != 0) { c[j] = c[j] + c[j - 1]; } else { c[j] = 1; } c[j] %= MOD; if(c[j]<0)throw new AssertionError(); } } System.out.println(dp[N]); sc.close(); } }