#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
long long f[505][505];
long long g[404040];
int main() {
  int n, K;
  cin >> n >> K;
  for (int i = 0; i <= n; i++) f[i][0] = 1;
  g[0] = 1;
  for (int i = 1; i <= n * n; i++) g[i] = (g[i - 1] * 2) % mod;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i && j <= K; j++)
      for (int k = j - 1; k < i; k++)
        f[i][j] = (f[i][j] +
                   f[k][j - 1] * g[k * (i - k)] % mod * (g[i - k] - 1) % mod) %
                  mod;
  cout << f[n][K] << endl;
  return 0;
}
