#include <bits/stdc++.h>
using namespace ::std;
const long long maxn = 502;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 500;
long long dp[maxn][maxn];
long long doo[maxn * maxn];
int main() {
  doo[0] = 1;
  for (long long i = 1; i < maxn * maxn; i++) {
    doo[i] = (doo[i - 1] * 2) % mod;
  }
  long long n, k;
  cin >> n >> k;
  dp[0][0] = 1;
  dp[1][0] = 1;
  dp[1][1] = 1;
  for (short i = 2; i <= n; i++) {
    dp[i][0] = 1;
    for (short j = 1; j <= k; j++) {
      for (short z = 1; z <= i; z++) {
        dp[i][j] += (dp[i - z][j - 1] *
                     ((doo[z * (i - z + 1)] - doo[z * (i - z)]) % mod)) %
                    mod;
      }
      dp[i][j] %= mod;
      dp[i][j] += mod;
      dp[i][j] %= mod;
    }
  }
  cout << dp[n][k];
}
