#include <bits/stdc++.h>
using namespace std;
const int inf = ~0U >> 1;
const long long INF = (long long)1e18;
const double pi = acos(-1.0);
template <class T>
inline T sqr(T a) {
  return a * a;
}
template <class T>
inline T min(T a, T b, T c) {
  return min(min(a, b), c);
}
template <class T>
inline T max(T a, T b, T c) {
  return max(max(a, b), c);
}
template <class T>
inline void read(T &n) {
  char c;
  for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar())
    ;
  n = c - '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int pw(int base, int n, int mo) {
  if (n == 0) return 1;
  if (n == 1) return base;
  int tmp = pw(base, n >> 1, mo);
  tmp = (long long)tmp * tmp % mo;
  if (n & 1) tmp = (long long)tmp * base % mo;
  return tmp;
}
const int mo = 1000000007;
int ans, power[1000], f[2][502][502];
int N, K;
inline void upd(int &x, int y) {
  x = (x + y);
  if (x >= mo) x -= mo;
}
int main() {
  scanf("%d%d", &N, &K);
  power[0] = 1;
  for (int i = (1); i <= (N + 2); ++i) power[i] = power[i - 1] * 2 % mo;
  f[1][0][0] = 1;
  for (int i = (1); i <= (N); ++i) {
    int cur = i & 1, nxt = (i + 1) & 1;
    memset(f[nxt], 0, sizeof(f[nxt]));
    for (int j = (0); j <= (K); ++j)
      for (int k = (0); k <= (i); ++k) {
        long long tmp = (long long)f[cur][j][k] * power[k] % mo;
        upd(f[nxt][j + 1][i], tmp * (power[i - k] - 1) % mo);
        upd(f[nxt][j][k], tmp);
      }
  }
  for (int i = (0); i <= (N); ++i) upd(ans, f[(N + 1) & 1][K][i]);
  printf("%d\n", ans);
  return 0;
}

### Prompt

Develop a solution in CPP to the problem described below:

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;
const int inf = ~0U >> 1;
const long long INF = (long long)1e18;
const double pi = acos(-1.0);
template <class T>
inline T sqr(T a) {
  return a * a;
}
template <class T>
inline T min(T a, T b, T c) {
  return min(min(a, b), c);
}
template <class T>
inline T max(T a, T b, T c) {
  return max(max(a, b), c);
}
template <class T>
inline void read(T &n) {
  char c;
  for (c = getchar(); !(c >= '0' && c <= '9'); c = getchar())
    ;
  n = c - '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) n = n * 10 + c - '0';
}
int pw(int base, int n, int mo) {
  if (n == 0) return 1;
  if (n == 1) return base;
  int tmp = pw(base, n >> 1, mo);
  tmp = (long long)tmp * tmp % mo;
  if (n & 1) tmp = (long long)tmp * base % mo;
  return tmp;
}
const int mo = 1000000007;
int ans, power[1000], f[2][502][502];
int N, K;
inline void upd(int &x, int y) {
  x = (x + y);
  if (x >= mo) x -= mo;
}
int main() {
  scanf("%d%d", &N, &K);
  power[0] = 1;
  for (int i = (1); i <= (N + 2); ++i) power[i] = power[i - 1] * 2 % mo;
  f[1][0][0] = 1;
  for (int i = (1); i <= (N); ++i) {
    int cur = i & 1, nxt = (i + 1) & 1;
    memset(f[nxt], 0, sizeof(f[nxt]));
    for (int j = (0); j <= (K); ++j)
      for (int k = (0); k <= (i); ++k) {
        long long tmp = (long long)f[cur][j][k] * power[k] % mo;
        upd(f[nxt][j + 1][i], tmp * (power[i - k] - 1) % mo);
        upd(f[nxt][j][k], tmp);
      }
  }
  for (int i = (0); i <= (N); ++i) upd(ans, f[(N + 1) & 1][K][i]);
  printf("%d\n", ans);
  return 0;
}

```