#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

const ll MOD = 998244353;

int main() {
    int n, x;
    cin >> n >> x;

    vector<vector<ll>> dp(x + 1, vector<ll>(512));
    for (int i = 0; i <= x; i++) dp[i][0] = 1;
    for (int i = 0; i < n; i++) {
        vector<vector<ll>> after(x + 1, vector<ll>(512));
        for (int nowNum = 0; nowNum <= x; nowNum++) {
            for (int nowXor = 0; nowXor < 512; nowXor++) {
                after[nowNum][nowXor] += dp[nowNum][nowXor ^ nowNum];
                after[nowNum][nowXor] %= MOD;
            }
        }

        for (int j = 0; j < 512; j++) {
            for (int k = 1; k <= x; k++) {
                after[k][j] += after[k - 1][j];
                after[k][j] %= MOD;
            }
        }

        dp = after;
    }

    cout << dp[x][x] << endl;
    return 0;
}

