#include <bits/stdc++.h>
using namespace std;
const int inf = ~0u >> 1, mod = (int)(1e9) + 7;
int n, m;
long long pow2[555 * 555], f[555][555];
int main() {
  scanf("%d%d", &n, &m);
  pow2[0] = 1ll;
  for (int i = 0; i < (int)500 * 500; ++i) pow2[i + 1] = (pow2[i] * 2ll) % mod;
  f[0][0] = 1ll;
  for (int k = 0; k < (int)m; ++k) {
    for (int i = 1; i <= n; ++i)
      for (int j = 0; j < i; ++j) {
        long long tmp = f[j][k];
        tmp = tmp * (pow2[i - j] - 1) % mod;
        tmp = tmp * (pow2[j * (i - j)]) % mod;
        f[i][k + 1] = (f[i][k + 1] + tmp) % mod;
      }
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i)
    ans = (ans + f[i][m] * pow2[i * (n - i)] % mod) % mod;
  if (m)
    cout << ans << endl;
  else
    cout << 1;
  return 0;
}
