#include <bits/stdc++.h>
using namespace std;
template <int n>
using AI = array<int, n>;
typedef AI<2> AII;
typedef AI<3> AI3;
typedef AI<4> AI4;
const double eps = 1e-9;
const int oo = 0x3F3F3F3F;
const long long ooLL = 0x3F3F3F3F3F3F3F3FLL;
const int MOD = 1000000007;
template <typename T>
T sqr(T x) {
  return x * x;
}
const double PI = acos(-1.);
long long Round(double x) { return x < 0 ? x - .5 : x + .5; }
int main() {
  void run();
  run();
  return 0;
}
void inc(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
int mul(long long a, int b) { return a * b % MOD; }
int inv(int a) {
  int b = MOD, r1 = 1, r2 = 0;
  while (b) {
    int q = a / b;
    a -= q * b;
    swap(a, b);
    r1 -= q * r2;
    swap(r1, r2);
  }
  if (r1 < 0) r1 += MOD;
  return r1;
}
const int N = 51;
int d[N][N][N][N], f[N][N], invd[N];
void ca() {
  for (int i = (1), __i(N); i < __i; ++i) invd[i] = inv(i);
  for (int n = (0), __n(N); n < __n; ++n)
    for (int m = (0), __m(N); m < __m; ++m) {
      for (int nl = (0), __nl(N); nl < __nl; ++nl)
        for (int ml = (0), __ml(N); ml < __ml; ++ml) {
          int &cu = d[n][m][nl][ml];
          if (nl == 0) {
            cu = n == 0 && m == 1;
            continue;
          }
          if (ml == 0) {
            cu = d[n][m][nl - 1][N - 1];
            continue;
          }
          cu = d[n][m][nl][ml - 1];
          for (int k = 1; k * nl <= n && k * ml <= m; ++k) {
            int e = f[nl][ml], x = 1;
            for (int it = (0), __it(k); it < __it; ++it)
              x = mul(x, e + k - 1 - it), x = mul(x, invd[it + 1]);
            inc(cu, mul(x, d[n - k * nl][m - k * ml][nl][ml - 1]));
          }
        }
      if (n && m) {
        for (int l = (0), __l(n); l < __l; ++l) {
          for (int lm = (m + 1), __lm(N); lm < __lm; ++lm)
            inc(f[n][m],
                mul(d[l][lm][N - 1][N - 1], d[n - 1 - l][m][N - 1][N - 1]));
          for (int rm = (m + 1), __rm(N); rm < __rm; ++rm)
            inc(f[n][m],
                mul(d[l][m][N - 1][N - 1], d[n - 1 - l][rm][N - 1][N - 1]));
          inc(f[n][m],
              mul(d[l][m][N - 1][N - 1], d[n - 1 - l][m][N - 1][N - 1]));
        }
      }
    }
}
void run() {
  ca();
  int n, m;
  scanf("%d %d", &n, &m);
  printf("%d\n", d[n][m][N - 1][N - 1]);
}
