#include <cstring>
#include <iostream>
using namespace std;

int main() {
    int n, x; cin >> n >> x;
    const int M = 998244353;
    long long dp[2][x+1][512], sum[x+1][512];
    memset(dp, 0, sizeof dp);
    memset(sum, 0, sizeof sum);
    int prev = 0, cur = 1;
    dp[prev][0][0] = 1;
    for (int j = 0; j <= x; j++) sum[j][0] = 1;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j <= x; j++)
            for (int k = 0; k < 512; k++)
                dp[cur][j][k] = sum[j][k^j];
        for (int j = 0; j <= x; j++)
            for (int k = 0; k < 512; k++)
                sum[j][k] = ((j > 0 ? sum[j-1][k] : 0) + dp[cur][j][k]) % M;
        swap(cur, prev);
    }
    long long ans = 0;
    for (int j = 0; j <= x; j++) ans += dp[prev][j][x];
    cout << ans % M << endl;
}

