#define NDEBUG
NDEBUG


#include <algorithm>
#include <cassert>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <memory>
#include <random>

#define FOR(i, n) for (int i = 0; i < (n); ++i)


typedef int64_t int64;


using namespace std;

// TC_REMOVE_BEGIN
/// caide keep
bool __hack = std::ios::sync_with_stdio(false);
/// caide keep
auto __hack1 = cin.tie(nullptr);
// TC_REMOVE_END


namespace template_util {
    

    constexpr int bytecount(uint64_t x) {
        return x ? 1 + bytecount(x >> 8) : 0;
    }

    /// caide keep
    template<int N>
    struct bytetype {
        
    };

    /// caide keep
    template<>
    struct bytetype<4> {
        
    };

    /// caide keep
    template<>
    struct bytetype<3> {
        
    };

    /// caide keep
    template<>
    struct bytetype<2> {
        
    };

    /// caide keep
    template<>
    struct bytetype<1> {
        
    };

    /// caide keep
    template<>
    struct bytetype<0> {
        
    };

    /// caide keep
    template<uint64_t N>
    struct minimal_uint : bytetype<bytecount(N)> {
    };
}


template<class T>
T next(istream& in) {
    T ret;
    in >> ret;
    return ret;
}


const int MOD = (int64) 1e9 + 7;

void solve(istream &in, ostream &out) {
    int n = next<int>(in);
    int m = next<int>(in);
    vector<vector<int>> f(n + 1, vector<int>(2));
    vector<vector<int>> fn(n + 1, vector<int>(2));
    FOR(i, n + 1) FOR(j, 2) {
            f[i][0] = 1;
        }

    FOR(s, m) {
        FOR(i, n + 1) {
            FOR(j, 2) {
                if (f[i][j]) {
                    int b = i;
                    int r = n - i;

                    // r-r
                    if (r) {
                        int nb = b + 1;
                        int nj = j;
                        if (r == 1) {
                            nj = 1;
                        }
                        fn[nb][nj] += f[i][j];
                        fn[nb][nj] %= MOD;
                    }

                    // b-b
                    if (b) {
                        int nb = b - 1;
                        int nj = j;
                        if (r == 0) {
                            nj = 1;
                        }
                        fn[nb][nj] += f[i][j];
                        fn[nb][nj] %= MOD;
                    }

                    // b-r
                    if (b) {
                        int nb = b;
                        int nj = j;
                        if (r == 0) {
                            nj = 1;
                        }
                        fn[nb][nj] += f[i][j];
                        fn[nb][nj] %= MOD;
                    }

                    // r-b
                    if (r) {
                        int nb = b;
                        int nj = j;
                        if (r == 1) {
                            nj = 1;
                        }
                        fn[nb][nj] += f[i][j];
                        fn[nb][nj] %= MOD;
                    }
                }
            }
        }
        f = fn;
        fn = vector<vector<int>>(n + 1, vector<int>(2, 0));
    }

    int res = 0;
    FOR(i, n + 1) {
        res += f[i][1];
        if (res >= MOD) {
            res -= MOD;
        }
    }
    out << res << endl;

}


int main() {
    solve(cin, cout);
    return 0;
}



Measured memory_bytes: 808