#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;
}

### Prompt

Your challenge is to write a cpp solution to the following problem:

Let's assume that set S consists of m distinct intervals [l1, r1], [l2, r2], ..., [lm, rm] (1 ≤ li ≤ ri ≤ n; li, ri are integers).

Let's assume that f(S) is the maximum number of intervals that you can choose from the set S, such that every two of them do not intersect. We assume that two intervals, [l1, r1] and [l2, r2], intersect if there is an integer x, which meets two inequalities: l1 ≤ x ≤ r1 and l2 ≤ x ≤ r2.

Sereja wonders, how many sets S are there, such that f(S) = k? Count this number modulo 1000000007 (109 + 7).

Input

The first line contains integers n, k (1 ≤ n ≤ 500; 0 ≤ k ≤ 500).

Output

In a single line, print the answer to the problem modulo 1000000007 (109 + 7).

Examples

Input

3 1


Output

23


Input

3 2


Output

32


Input

2 0


Output

1


Input

2 2


Output

2

### Response

```cpp
#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;
}

```