You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
355 B

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 1010, MOD = 1e9 + 7;
int n;
int f[N];
int main() {
cin >> n;
f[0] = 1;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= i; j++)
f[i] = (f[i] + (LL)f[j - 1] * f[i - j]) % MOD;
cout << f[n] << endl;
return 0;
}