#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long ans = 0;
void add(long long &a, long long b) {
  if (b < 0) b += MOD;
  a = (a + b) % MOD;
  ans += a;
  if (ans >= MOD) ans -= MOD;
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m < n) swap(m, n);
  long long a[n + 2][n + 1], b[n + 1][n + 1], c[n + 1][n + 1];
  int i, j;
  for (i = 0; i <= n; ++i) {
    for (j = i; j <= n; ++j) a[i][j] = b[i][j] = c[i][j] = 0;
    a[i][i] = a[i + 1][i] = 1;
  }
  for (; m > 0; --m) {
    for (i = 1; i < n - 1; ++i)
      for (j = n - 1; j > i; --j)
        add(c[i][j], c[i - 1][j] + c[i][j + 1] - c[i - 1][j + 1] +
                         a[i - 1][j + 1] + b[i - 1][j] + b[n - j - 1][n - i]);
    for (i = n - 2; i >= 0; --i)
      for (j = n - 1; j > i; --j)
        add(b[i][j], b[i + 1][j] + b[i][j + 1] - b[i + 1][j + 1] + a[i][j + 1]),
            ans += b[i][j];
    for (i = n - 1; i >= 0; --i)
      for (j = i + 1; j <= n; ++j)
        add(a[i][j], a[i + 1][j] + a[i][j - 1] - a[i + 1][j - 1]);
  }
  cout << ans;
  return 0;
}
