#include <bits/stdc++.h>
using namespace std;
const int N = 1000000 + 7;
const int M = 32;
const long long base = 1e18;
const int mod = 999983;
const int inf = 1e9 + 7;
const double pi = acos(-1);
const int maxn = N * 2;
const double PI = acos(-1);
const double ep = 1e-9;
int n, k;
long long dp[507][507];
long long lt2[507];
long long pw2(int x) {
  if (x == 0) return 1;
  if (x & 1) return pw2(x - 1) * 2 % inf;
  long long tmp = pw2(x / 2);
  return tmp * tmp % inf;
}
void solve() {
  cin >> n >> k;
  dp[0][0] = 1;
  long long ans = 0;
  lt2[0] = 1;
  for (int i = (1); i < (507); i++) lt2[i] = lt2[i - 1] * 2 % inf;
  for (int i = (1); i < (n + 1); i++) {
    for (int t = (1); t < (k + 1); t++) {
      dp[i][t] = 0;
      for (int j = (0); j < (i); j++) {
        dp[i][t] = (dp[i][t] + dp[j][t - 1] * (lt2[i - j] - 1 + inf)) % inf;
      }
      for (int j = (0); j < (i); j++) {
        dp[j][t] = (dp[j][t] * lt2[j] % inf);
      }
    }
  }
  for (int i = (0); i < (n + 1); i++) ans = (ans + dp[i][k]) % inf;
  cout << ans;
}
int main() {
  int T = 1;
  for (int i = (1); i < (T + 1); i++) {
    solve();
  }
}
