#include <bits/stdc++.h>
using namespace std;
void reader(int *x) {
  int k, m = 0;
  *x = 0;
  for (;;) {
    (k) = getchar();
    if (k == '-') {
      m = 1;
      break;
    }
    if ('0' <= k && k <= '9') {
      *x = k - '0';
      break;
    }
  }
  for (;;) {
    (k) = getchar();
    if (k < '0' || k > '9') break;
    *x = (*x) * 10 + k - '0';
  }
  if (m) (*x) = -(*x);
}
void writer(int x, char c) {
  int i, sz = 0, m = 0;
  char buf[10];
  if (x < 0) m = 1, x = -x;
  while (x) buf[sz++] = x % 10, x /= 10;
  if (!sz) buf[sz++] = 0;
  if (m) putchar('-');
  while (sz--) putchar(buf[sz] + '0');
  putchar(c);
}
long long dp[510][510];
long long pw[125510];
long long pwpw[510][510];
int main() {
  int N, K;
  int i, j, l, m;
  pw[0] = 1;
  for (i = 1; i < 125510; i++) {
    pw[i] = pw[i - 1] * 2;
    if (pw[i] >= 1000000007) pw[i] -= 1000000007;
  }
  for (i = 0; i < 501; i++)
    for (m = 1; m < i + 1; m++)
      pwpw[i][m] = (pw[m] - 1) * pw[m * (i - m)] % 1000000007;
  reader(&N);
  reader(&K);
  for (i = 0; i < 501; i++)
    for (j = 0; j < 501; j++) dp[i][j] = 0;
  for (i = 0; i < 501; i++) dp[i][0] = 1;
  for (i = 0; i < 501; i++)
    for (j = 1; j < i + 1; j++) {
      dp[i][j] = 0;
      for (m = 1; m < i + 1; m++)
        dp[i][j] = (dp[i][j] + dp[i - m][j - 1] * pwpw[i][m]) % 1000000007;
    }
  dp[N][K] %= 1000000007;
  if (dp[N][K] < 0) dp[N][K] += 1000000007;
  writer((int)dp[N][K], '\n');
  return 0;
}
