#include <bits/stdc++.h>
using namespace std;
int n, m, d[510][510];
long long p2[510 * 510];
int main() {
  p2[0] = 1;
  for (int i = 1; i <= 510 * 510 - 1; i++) p2[i] = p2[i - 1] * 2 % 1000000007;
  scanf("%d%d", &n, &m);
  d[0][0] = 1;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) {
      for (int k = 0; k <= j - 1; k++)
        d[i][j] = (d[i][j] + d[i - 1][k] * p2[(j - k) * k] % 1000000007 *
                                 (p2[j - k] - 1) % 1000000007) %
                  1000000007;
    }
  int ans = 0;
  for (int i = 0; i <= n; i++)
    ans = (ans + d[m][i] * p2[i * (n - i)] % 1000000007) % 1000000007;
  printf("%d\n", (ans + 1000000007) % 1000000007);
  return 0;
}
