#include <bits/stdc++.h>
using namespace std;
const int N = 55, mod = 1e9 + 7;
int nck[N][N];
int inv2[N], fact[N];
int dp[N][N][N][N];
int dp2[N][N][N];
int bm(int b, int p) {
  if (p == 0) return 1;
  int t = bm(b, p / 2);
  t = 1ll * t * t % mod;
  if (p & 1) return 1ll * b * t % mod;
  return t;
}
int ncr(int n, int r) {
  if (r > n or r < 0) return 0;
  return nck[n][r];
}
int n, K;
int solve(int m, int um, int r, int totm) {
  if (r <= 0 or totm < 0) return 0;
  if (r == 1) return totm == 0;
  if (dp[m][um][r][totm] != -1) return dp[m][um][r][totm];
  int ways = 0;
  for (int p = (m + um + 1) / 2; p + m + um <= r; p++) {
    for (int pm = (um + 1) / 2; pm <= min(p, um); pm++) {
      int cur_ways = solve(pm, p - pm, r - m - um, totm - pm);
      cur_ways = 1ll * cur_ways * ncr(r - 1, m + um) % mod;
      cur_ways = 1ll * cur_ways * ncr(m + um, m) % mod;
      cur_ways = 1ll * cur_ways * ncr(pm, um - pm) % mod;
      cur_ways = 1ll * cur_ways * fact[um] % mod;
      cur_ways = 1ll * cur_ways * inv2[um - pm] % mod;
      int one = 2 * pm - um, two = p - pm;
      cur_ways = 1ll * cur_ways * dp2[one][two][m] % mod;
      ways += cur_ways;
      ways %= mod;
    }
  }
  return dp[m][um][r][totm] = ways;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  nck[0][0] = 1;
  inv2[0] = 1;
  fact[0] = 1;
  for (int i = 1; i < N; i++) {
    nck[i][0] = 1;
    fact[i] = 1ll * i * fact[i - 1] % mod;
    inv2[i] = 1ll * inv2[i - 1] * bm(2, mod - 2) % mod;
    for (int j = 1; j <= i; j++) {
      nck[i][j] = (nck[i - 1][j] + nck[i - 1][j - 1]) % mod;
    }
  }
  for (int two = 0; two < N; two++) {
    for (int one = 0; one < N; one++) {
      dp2[one][two][0] = 1;
      for (int m = 1; m < N; m++) {
        if (one > 0)
          dp2[one][two][m] += 1ll * one * dp2[one - 1][two][m - 1] % mod;
        if (two > 0 && one + 1 < N)
          dp2[one][two][m] += 1ll * two * dp2[one + 1][two - 1][m - 1] % mod;
        dp2[one][two][m] %= mod;
      }
    }
  }
  cin >> n >> K;
  memset(dp, -1, sizeof dp);
  int ways = 0;
  for (int l = 1; l < n; l++) {
    ways += solve(0, l, n, K);
    ways %= mod;
  }
  cout << ways << endl;
  return 0;
}

### Prompt

Your task is to create a Cpp solution to the following problem:

Ksenia has her winter exams. Today she is learning combinatorics. Here's one of the problems she needs to learn to solve.

How many distinct trees are there consisting of n vertices, each with the following properties:

  * the tree is marked, that is, the vertices of the tree are numbered from 1 to n; 
  * each vertex of the tree is connected with at most three other vertices, and at the same moment the vertex with number 1 is connected with at most two other vertices; 
  * the size of the tree's maximum matching equals k. 



Two trees are considered distinct if there are such two vertices u and v, that in one tree they are connected by an edge and in the other tree they are not.

Help Ksenia solve the problem for the given n and k. As the answer to the problem can be very huge you should output it modulo 1000000007 (109 + 7).

Input

The first line contains two integers n, k (1 ≤ n, k ≤ 50).

Output

Print a single integer — the answer to the problem modulo 1000000007 (109 + 7).

Examples

Input

1 1


Output

0


Input

2 1


Output

1


Input

3 1


Output

3


Input

4 2


Output

12

Note

If you aren't familiar with matchings, please, read the following link: http://en.wikipedia.org/wiki/Matching_(graph_theory).

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const int N = 55, mod = 1e9 + 7;
int nck[N][N];
int inv2[N], fact[N];
int dp[N][N][N][N];
int dp2[N][N][N];
int bm(int b, int p) {
  if (p == 0) return 1;
  int t = bm(b, p / 2);
  t = 1ll * t * t % mod;
  if (p & 1) return 1ll * b * t % mod;
  return t;
}
int ncr(int n, int r) {
  if (r > n or r < 0) return 0;
  return nck[n][r];
}
int n, K;
int solve(int m, int um, int r, int totm) {
  if (r <= 0 or totm < 0) return 0;
  if (r == 1) return totm == 0;
  if (dp[m][um][r][totm] != -1) return dp[m][um][r][totm];
  int ways = 0;
  for (int p = (m + um + 1) / 2; p + m + um <= r; p++) {
    for (int pm = (um + 1) / 2; pm <= min(p, um); pm++) {
      int cur_ways = solve(pm, p - pm, r - m - um, totm - pm);
      cur_ways = 1ll * cur_ways * ncr(r - 1, m + um) % mod;
      cur_ways = 1ll * cur_ways * ncr(m + um, m) % mod;
      cur_ways = 1ll * cur_ways * ncr(pm, um - pm) % mod;
      cur_ways = 1ll * cur_ways * fact[um] % mod;
      cur_ways = 1ll * cur_ways * inv2[um - pm] % mod;
      int one = 2 * pm - um, two = p - pm;
      cur_ways = 1ll * cur_ways * dp2[one][two][m] % mod;
      ways += cur_ways;
      ways %= mod;
    }
  }
  return dp[m][um][r][totm] = ways;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  nck[0][0] = 1;
  inv2[0] = 1;
  fact[0] = 1;
  for (int i = 1; i < N; i++) {
    nck[i][0] = 1;
    fact[i] = 1ll * i * fact[i - 1] % mod;
    inv2[i] = 1ll * inv2[i - 1] * bm(2, mod - 2) % mod;
    for (int j = 1; j <= i; j++) {
      nck[i][j] = (nck[i - 1][j] + nck[i - 1][j - 1]) % mod;
    }
  }
  for (int two = 0; two < N; two++) {
    for (int one = 0; one < N; one++) {
      dp2[one][two][0] = 1;
      for (int m = 1; m < N; m++) {
        if (one > 0)
          dp2[one][two][m] += 1ll * one * dp2[one - 1][two][m - 1] % mod;
        if (two > 0 && one + 1 < N)
          dp2[one][two][m] += 1ll * two * dp2[one + 1][two - 1][m - 1] % mod;
        dp2[one][two][m] %= mod;
      }
    }
  }
  cin >> n >> K;
  memset(dp, -1, sizeof dp);
  int ways = 0;
  for (int l = 1; l < n; l++) {
    ways += solve(0, l, n, K);
    ways %= mod;
  }
  cout << ways << endl;
  return 0;
}

```