#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcountll
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC

const int MOD = 998244353;
int mod(int n) {
    n %= MOD;
    if (n < 0) return n + MOD;
    else return n;
}   
int fp(int a, int p) {
    int ans = 1, c = a;
    for (int i = 0; (1ll << i) <= p; ++i) {
        if ((p >> i) & 1) ans = mod(ans * c);
        c = mod(c * c);
    }   
    return ans;
}   
int dv(int a, int b) { return mod(a * fp(b, MOD - 2)); }

const int N = 3007;
int f[N], inv[N];
void prec() {
    f[0] = 1;
    for (int i = 1; i < N; ++i)
        f[i] = mod(f[i - 1] * i);
    inv[N - 1] = fp(f[N - 1], MOD - 2);
    for (int i = N - 2; i >= 0; --i)
        inv[i] = mod(inv[i + 1] * (i + 1));
}
int C(int n, int k) {
    return mod(f[n] * mod(inv[k] * inv[n - k]));
}   
void add(int &a, int b) {
    a = mod(a + b);
}   

int dp1[N][2 * N], dp2[N][2 * N], pref[2][N][2 * N];
void calc_dp() {
    dp1[0][0] = 1;
    for (int i = 0; i + 1 < N; ++i) {
        for (int j = 0; j <= i * 2; ++j) {
            for (int x = 1; x <= 2; ++x) {
                add(dp1[i + 1][j + x], dp1[i][j]);
            }
        }   
    }   
    dp2[1][2] = 1;
    for (int i = 1; i + 1 < N; ++i) {
        for (int j = 0; j <= i * 2; ++j) {
            for (int x = 1; x <= 2; ++x) {
                add(dp2[i + 1][j + x], dp2[i][j]);
            }
        }   
    }   
    dp1[1][2] = 0;
    for (int i = 1; i + 1 < N; ++i) {
        for (int j = 0; j <= i * 2; ++j) {
            add(dp1[i + 1][j + 2], -dp2[i][j]);
        }   
    }
    for (int t = 0; t < 2; ++t) {
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j + 1 < 2 * N; ++j) {
                pref[t][i][j + 1] = pref[t][i][j];
                if ((j&1)==t)
                    add(pref[t][i][j+1], dp1[i][j]); 
            }   
        }   
    }   
}   

int get(int len, int l, int r, int t) {
    //cant be 2 in front and in back

    //cout << "get " << len << ' ' << sum << " : " << dp1[len][sum] << endl;

    return mod(pref[t][len][r + 1] - pref[t][len][l]);
}   

signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    #define endl '\n'
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif

    prec();
    calc_dp();

    int n, x;
    cin >> n >> x;

    //there is no 1
    int ans = 0;
    for (int c1 = 0; c1 <= n; ++c1) {
        for (int c2 = 0; c1 + c2 <= n; ++c2) {
            if (c1 + 2 * c2 < x) {
                add(ans, C(n, c1) * C(n - c1, c2));
            }   
        }   
    }   

    #ifdef HOME
    cout << ans << endl;
    #endif

    for (int c2 = 0; c2 <= n; ++c2) {
        if (x % 2 && c2 * 2 >= x) {
            add(ans, C(n, c2));
        }   
    }   

    #ifdef HOME
    cout << ans << endl;
    #endif

    for (int len = 1; len <= n; ++len) {
        for (int k = 1; k * 2 < len; ++k) {
            int mid = len - 2 * k;

            int l = max(1ll, x - 4 * k);
            int r = x - 2 * k - 1;
            if (l <= r) {
                int w = (x&1)^1;
                add(ans, get(mid, l, r, w) * C(n, len));
            }
        }   
    }
    cout << ans << endl;
}

Measured memory_bytes: 565376