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 JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.BigInteger;
import java.util.Collections.*;
import static java.lang.Math.*;
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.util.Arrays.*;
import static java.math.BigInteger.*;


public class Main{

    void run(){
        Locale.setDefault(Locale.US);
        boolean my;
        try {
            my = System.getProperty("MY_LOCAL") != null;
        } catch (Exception e) {
            my = false;

        }
        try{
            err = System.err;
            if( my ){
                sc  = new FastScanner(new BufferedReader(new FileReader("input.txt")));
//                sc  = new FastScanner(new BufferedReader(new FileReader("C:\\myTest.txt")));
                out = new PrintWriter   (new FileWriter("output.txt"));
            }
            else {
                sc = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
                out = new PrintWriter(new OutputStreamWriter(System.out));
            }
//            out = new PrintWriter(new OutputStreamWriter(System.out));
        }catch(Exception e){
            MLE();
        }
        if( my )
            tBeg = System.currentTimeMillis();
        solve();
        if( my )
            err.println( "TIME: " + (System.currentTimeMillis() - tBeg ) / 1e3 );
        exit(0);
    }

    void exit( int val ){
        err.flush();
        out.flush();
        System.exit(val);
    }

    double tBeg;
    FastScanner sc;
    PrintWriter out;
    PrintStream err;

    class FastScanner{

        StringTokenizer st;
        BufferedReader br;

        FastScanner( BufferedReader _br ){
            br = _br;
        }

        String readLine(){
            try {
                return br.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        String next(){
            while( st==null || !st.hasMoreElements() )
                st = new StringTokenizer(readLine());
            return st.nextToken();
        }

        int nextInt(){ return Integer.parseInt(next()); }
        long nextLong(){ return Long.parseLong(next()); }
        double nextDouble(){ return Double.parseDouble(next()); }
    }

    void MLE(){
        int[][] arr = new int[1024*1024][]; for( int i = 0; i < 1024*1024; ++i ) arr[i] = new int[1024*1024];
    }

    void MLE( boolean doNotMLE ){ if( !doNotMLE ) MLE(); }

    void TLE(){
        for(;;);
    }

    public static void main(String[] args) {
        new Main().run();
//        new Thread( null, new Runnable() {
//            @Override
//            public void run() {
//                new Main().run();
//            }
//        }, "Lolka", 256_000_000L ).run();
    }

    ////////////////////////////////////////////////////////////////

    final int mod = (int)1e9 + 7;
    int n, k;
    int[][] dp0, dp1;
    int[] pow2 = new int[600];
    {
        pow2[0] = 1;
        for (int i = 1; i < pow2.length; i++) {
            pow2[i] = (pow2[i-1] * 2) % mod;
        }
    }

    void solve(){
        n = sc.nextInt();
        k = sc.nextInt();
        dp0 = new int[k+1][n+1];
        dp1  = new int[k+1][n+1];
        for (int[] val : dp0) fill(val, 0);

        for (int sz = 1; sz <= n; sz++) {

            for (int cnt  = 0; cnt <= k; cnt++) {
                int[] dp1_cnt = dp1[cnt];
                int[] dp1_cnt1 = null; if( cnt+1<=k ) dp1_cnt1 = dp1[cnt+1];
                int[] dp0_cnt = dp0[cnt];
                for (int last = 0; last <= sz; last++) {
                    if( cnt == 0 ){
                        if( last == 0 ) dp1_cnt[last] = 1;
                        else dp1_cnt[last] = 0;
                    }
                    else if( sz == last ){
                        if( cnt == 1 ){
                            dp1_cnt[last] = pow2[last] - 1;
                        }
                    }
                    else{
                        if( dp0_cnt[last] !=0  )
                            dp1_cnt[last] = (int)( (1L * dp0_cnt[last] * pow2[last]) % mod );
                    }

                    if( 1<=last && last <= sz-1   &&   1 <= cnt && cnt+1 <= k ){
                        if( dp1_cnt[last] != 0 )
                        dp1_cnt1[sz] =
                                (int)(
                                    (dp1_cnt1[sz] + 1L*dp1_cnt[last] * (pow2[sz-last]-1)) % mod
                                );
                    }
                }
            }
           //
            for (int cnt  = 0; cnt <= k; cnt++) {
                int[] dp1_cnt = dp1[cnt];
                int[] dp0_cnt = dp0[cnt];
                for (int last = 0; last <= sz; last++) {
                    dp0_cnt[last] = dp1_cnt[last];
                    dp1_cnt[last] = 0;
                }
            }
        }
        long ans = 0;
        for (int last = 0; last <= n; last++) {
            ans += dp0[k][last];
        }
        ans %= mod;
        out.println( ans );
    }


}