#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, y, z, dp[2][(int)(505)][(int)(505)], a, b, pw[(int)(505)];
int main() {
  pw[0] = 1;
  for (i = 1; i < (int)(505); i++) pw[i] = pw[i - 1] * 2 % 1000000007;
  cin >> n >> k;
  for (i = 0; i <= n; i++) dp[(n + 1) & 1][k][i] = 1;
  for (x = n; x >= 1; x--)
    for (a = k; a >= 0; a--)
      for (b = x - 1; b >= 0; b--)
        dp[x & 1][a][b] = ((long long)dp[(x + 1) & 1][a][b] * pw[b] +
                           (long long)dp[(x + 1) & 1][a + 1][x] * pw[b] %
                               1000000007 * (pw[x - b] - 1)) %
                          1000000007;
  cout << dp[1][0][0] << '\n';
}
