#include <iostream>
#include <vector>

template <int MOD>
struct ModInt {
    using lint = long long;
    using mint = ModInt<MOD>;

    int val;

    // constructor
    ModInt(lint v = 0) : val(v % MOD) {
        if (val < 0) val += MOD;
    };

    // assignment
    ModInt& operator=(const ModInt& x) {
        if (this != &x) { this->val = x.val; }
        return *this;
    }

    // unary operator
    ModInt operator+() const { return ModInt(val); }
    ModInt operator-() const { return ModInt(MOD - val); }
    ModInt operator~() const {
        // non-recursive extended euclidean algorithm
        int s = val, t = MOD;
        mint sx = 1, sy = 0, tx = 0, ty = 1;
        while (s % t != 0) {
            int div = s / t;
            s -= t * div;
            sx -= tx * div;
            sy -= ty * div;

            std::swap(s, t);
            std::swap(sx, tx);
            std::swap(sy, ty);
        }
        return mint(tx);
    }

    // arithmetic
    ModInt operator+(const ModInt& x) const { return ModInt(*this) += x; }
    ModInt operator-(const ModInt& x) const { return ModInt(*this) -= x; }
    ModInt operator*(const ModInt& x) const { return ModInt(*this) *= x; }
    ModInt operator/(const ModInt& x) const { return ModInt(*this) /= x; }

    // compound assignment
    ModInt& operator+=(const ModInt& x) {
        if ((val += x.val) >= MOD) val -= MOD;
        return *this;
    }
    ModInt& operator-=(const ModInt& x) {
        if ((val -= x.val) < 0) val += MOD;
        return *this;
    }
    ModInt& operator*=(const ModInt& x) {
        val = lint(val) * x.val % MOD;
        return *this;
    }
    ModInt& operator/=(const ModInt& x) { return *this *= ~x; }

    // compare
    bool operator==(const ModInt& b) const { return val == b.val; }
    bool operator!=(const ModInt& b) const { return val != b.val; }

    // I/O
    friend std::ostream& operator<<(std::ostream& os, const ModInt& x) noexcept { return os << x.val; }
};

constexpr int MOD = 1e9 + 7;
using mint = ModInt<MOD>;

template <class T, class Int>
T ipow(T b, Int n) {
    T ret = 1;
    while (n > 0) {
        if (n & 1) ret *= b;
        n >>= 1;
        b *= b;
    }
    return ret;
}

int main() {
    int n, m;
    std::cin >> n >> m;
    mint ans = ipow(mint(2), m * 2);
    mint out = 0;

    std::vector<std::vector<mint>>
        dp(2, std::vector<mint>(n + 1, 0)),
        ndp(2, std::vector<mint>(n + 1));
    // 途中で青が0になったか, 赤の個数

    // 初期状態の和
    for (int r = 0; r <= n; ++r) {
        dp[r == n][r] = 1;
    }

    for (int i = 0; i < m; ++i) {
        out += dp[true][0] * ipow(mint(2), (m - i) * 2 - 1);
        // 矛盾した後は自由に並べられるので，後ろの係数がつく

        for (auto& v : ndp) {
            std::fill(v.begin(), v.end(), 0);
        }

        for (int b = 0; b < 2; ++b) {
            for (int r = 0; r <= n; ++r) {
                if (r > 0) {
                    // RB
                    ndp[b][r] += dp[b][r];
                    // RR
                    ndp[b][r - 1] += dp[b][r];
                }
                if (r < n) {
                    // 操作中に青玉が0になるかどうか
                    bool nb = b || (r == n - 1);
                    // BR
                    ndp[nb][r] += dp[b][r];
                    // BB
                    ndp[nb][r + 1] += dp[b][r];
                }
            }
        }
        std::swap(dp, ndp);
    }

    std::cout << ans - out * 2 << std::endl;
    return 0;
}


Measured memory_bytes: 256