#include <bits/stdc++.h>
using namespace std;
long long fn(int i, int left);
long long powr(long long base, long long exp);
long long tabular();
long long dp[505][505];
const long long MOD = 1000000007;
int n, k;
int main() {
  scanf("%d %d", &n, &k);
  memset(dp, -1, sizeof(dp));
  printf("%lld\n", fn(0, k));
  return 0;
}
long long tabular() {
  long long ans = 0;
  for (int last = 0; last <= n; last++)
    for (int i = n; i >= 0; i--)
      if (last <= i)
        for (int left = 0; left <= k; left++) {
          long long cnt = 0;
          {
            long long &ret = dp[i][left];
            ret = 0;
            if (i == n)
              ret = (left == 0);
            else {
              long long tmp = (powr(2, i - last + 1) - 1 + MOD) % MOD;
              tmp = tmp * powr(2, last) % MOD;
              if (left) ret += dp[i + 1][left - 1] * tmp % MOD, ret %= MOD;
              ret += dp[i + 1][left] * powr(2, last) % MOD, ret %= MOD;
              ;
            }
            if (i == 0 && left == k) {
              ans = ret;
              break;
            }
          }
        }
  return dp[0][k];
}
long long fn(int i, int left) {
  if (left < 0) return 0;
  if (i == n) return left == 0;
  long long &ret = dp[i][left];
  if (ret != -1) return ret;
  ret = 0;
  if (left == 0) {
    ret = 1;
    for (int j = i; j < n; j++) ret = ret * powr(2, i) % MOD;
    return ret;
  }
  long long cnt = 1;
  for (int nxt = i; nxt < n && (n - nxt - 1) >= left - 1; nxt++) {
    cnt = cnt * powr(2, i) % MOD;
    long long tmp = (powr(2, nxt - i + 1) - 1 + MOD) % MOD;
    tmp = tmp * cnt % MOD;
    ret += fn(nxt + 1, left - 1) * tmp % MOD, ret %= MOD;
  }
  return ret;
}
long long powr(long long base, long long exp) {
  if (exp < 0 || base < 0) return 1;
  if (exp == 0) return 1;
  if (exp == 1) return base;
  if (exp % 2) return (base % MOD * powr(base, exp - 1)) % MOD;
  long long ret = powr(base, exp / 2);
  return (ret * ret) % MOD;
}
