#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500 + 10, MOD = (int)1e9 + 7;
int n, k, f[MAXN][MAXN], Pow[MAXN * MAXN];
void init() {
  cin >> n >> k;
  if (!k) puts("1"), exit(0);
  Pow[0] = 1;
  for (int i = 1; i <= n * n; ++i) Pow[i] = Pow[i - 1] * 2 % MOD;
}
void solve() {
  f[0][0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= k; ++j)
      for (int p = 0; p < i; ++p)
        f[i][j] =
            ((long long)f[i][j] + (long long)f[p][j - 1] * (Pow[i - p] - 1) %
                                      MOD * Pow[(i - p) * (n - i)] % MOD) %
            MOD;
  int Tohka = 0;
  for (int i = 1; i <= n; ++i) Tohka = (Tohka + f[i][k]) % MOD;
  cout << Tohka << endl;
}
int main() {
  init();
  solve();
  fclose(stdin);
  fclose(stdout);
  return 0;
}
