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

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long double Eps = 1e-8;
inline bool is_zero(long double x) { return (x >= -Eps) && (x <= Eps); }
const int MOD = 1000000007;
int N, K;
int DP[2][505][505];
int pwr[505];
void input() {
  scanf("%d%d", &N, &K);
  pwr[0] = 1;
  for (int i = 1; i <= 503; i++) pwr[i] = (pwr[i - 1] * 2) % MOD;
}
int main() {
  input();
  int sum = 0;
  for (int n = 0; n <= N; n++) {
    int nb = n % 2;
    int nbp = nb ^ 1;
    for (int k = 0; k <= K; k++)
      for (int p = 0; p <= n; p++) DP[nb][k][p] = 0;
    DP[nb][0][0] = 1;
    for (int k = 1; k <= K; k++) {
      DP[nb][k][0] = 0;
      for (int p = 0; p <= n; p++) {
        DP[nb][k][p] =
            (DP[nb][k][p] + (long long)DP[nbp][k][p] * (pwr[p])) % MOD;
        int mult = ((long long)pwr[p] * (pwr[n - p] + MOD - 1)) % MOD;
        DP[nb][k][n] =
            (DP[nb][k][n] + (long long)DP[nbp][k - 1][p] * mult) % MOD;
      }
    }
  }
  for (int p = 0; p <= N; p++) sum = (sum + DP[N % 2][K][p]) % MOD;
  printf("%d\n", sum);
  return 0;
}