#include <bits/stdc++.h>
using namespace std;
inline int get() {
  char c;
  while (!isdigit(c = getchar()))
    ;
  int v = c - 48;
  while (isdigit(c = getchar())) v = v * 10 + c - 48;
  return v;
}
const int mod = 1e9 + 7;
int n, m, f[505][505];
long long pw[505];
int main() {
  n = get();
  m = get();
  f[0][0] = 1;
  pw[0] = 1;
  for (int i = 1; i <= 500; ++i) pw[i] = pw[i - 1] * 2 % mod;
  for (int i = 1; i <= n; ++i)
    for (int j = min(i, m); j >= 0; --j)
      for (int k = 0; k < i; ++k) {
        f[j][k] = f[j][k] * pw[k] % mod;
        if (j)
          f[j][i] =
              (f[j][i] + f[j - 1][k] * (pw[i - k] - 1) % mod * pw[k]) % mod;
      }
  long long as = 0;
  for (int i = 0; i <= n; ++i) as += f[m][i];
  cout << as % mod << endl;
  return 0;
}
