#include <bits/stdc++.h>
using namespace std;
template <typename T>
T Abs(T first) {
  return (first < 0 ? -first : first);
}
template <typename T>
T Sqr(T first) {
  return (first * first);
}
string plural(string s) {
  return (int((s).size()) && s[int((s).size()) - 1] == 'x' ? s + "en"
                                                           : s + "s");
}
const int INF = (int)1e9;
const double EPS = 1e-9;
const long double PI = acos(-1.0);
bool Read(int &first) {
  char c, r = 0, n = 0;
  first = 0;
  for (;;) {
    c = getchar();
    if ((c < 0) && (!r)) return (0);
    if ((c == '-') && (!r))
      n = 1;
    else if ((c >= '0') && (c <= '9'))
      first = first * 10 + c - '0', r = 1;
    else if (r)
      break;
  }
  if (n) first = -first;
  return (1);
}
int main() {
  if (0) freopen("in.txt", "r", stdin);
  int N, K;
  int i, j, k, jj, c;
  long long d, p;
  int X, Y;
  static int dyn[2][502][502];
  int pw[502];
  pw[0] = 1;
  for (i = 1; i <= 501; i++) {
    pw[i] = pw[i - 1] << 1;
    if (pw[i] >= 1000000007) pw[i] -= 1000000007;
  }
  Read(N), Read(K);
  X = 0, Y = 1;
  dyn[Y][0][1] = 1;
  for (i = 1; i <= N; i++) {
    swap(X, Y);
    memset(dyn[Y], 0, sizeof(dyn[Y]));
    jj = min(i, K + 1);
    for (j = 0; j < jj; j++)
      for (k = 1; k <= i; k++)
        if (d = dyn[X][j][k]) {
          c = i - k;
          dyn[Y][j][k + 1] = (dyn[Y][j][k + 1] + d * pw[c]) % 1000000007;
          if (j < K) {
            p = (long long)pw[c] * (pw[k] - 1) % 1000000007;
            dyn[Y][j + 1][1] = (dyn[Y][j + 1][1] + d * p) % 1000000007;
          }
        }
  }
  int ans = 0;
  for (k = 1; k <= N + 1; k++) {
    ans += dyn[Y][K][k];
    if (ans >= 1000000007) ans -= 1000000007;
  }
  printf("%d\n", ans);
  return (0);
}
