#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long dp[555][555];
int n, k;
long long two[555 * 555];
void update(long long &a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
}
int main() {
  two[0] = 1;
  for (int i = 1; i <= 500 * 500; i++) two[i] = two[i - 1] * 2 % mod;
  cin >> n >> k;
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      for (int l = 0; l <= i - 1; l++) {
        update(dp[i][j], dp[l][j - 1] * two[(i - l) * l] % mod *
                             (two[i - l] + mod - 1) % mod);
      }
    }
  }
  long long ans = 0;
  for (int i = 0; i <= n; i++) update(ans, dp[i][k] * two[(n - i) * i] % mod);
  cout << ans << endl;
  return 0;
}
