#include <iostream>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <deque>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <climits>
#include <bitset>
#include <random>
#include <tuple>
#include <initializer_list>
#include <fstream>
constexpr long long int MOD = 998244353;
static std::vector<std::vector<long long int>> memo_just;
static std::vector<std::vector<long long int>> memo_below;
static std::vector<long long int> factorial;
static std::vector<long long int> inv_factorial;
static std::vector<long long int> odd;
long long int combination(int n, int r) {
	if (n < r) {
		return 0;
	}
	return factorial[n] * inv_factorial[n - r] % MOD * inv_factorial[r] % MOD;
}
long long int choice_even(int n);
long long int choice_odd(int n) {
	if (n == 0) return 0;
	if (odd[n] >= 0) return odd[n];
	return odd[n] = (choice_odd(n - 1) + choice_even(n - 1)) % MOD;
}
long long int choice_even(int n) {
	if (n == 0) return 1;
	return choice_odd(n);
}
long long int count_just(int n, int x);
long long int count_below(int n, int x);
long long int count_just(int n, int x) {
	if (n == 1) return x != 0 ? 1 : 0;
	if (n == 0) return 0;
	if (n > x) return 0;
	if (memo_just[n][x] >= 0) return memo_just[n][x];
	if (x % 2 == 0) {
		long long int result = count_below(n, x);
		for (auto use = 1; use <= n; ++use) {
			const auto rest = n - use;
			const auto not_use = (x >> 1) - use;
			if (rest > not_use * 2 + 1) continue;
			const auto use_count = (count_just(use, x >> 1) - count_below(use, x >> 1) + MOD) % MOD;
			if (rest % 2 == 0) {
				if ((rest >> 1) % 2 == 0) {
					result += use_count * choice_even(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
				}
				else {
					result += use_count * choice_odd(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
				}
			}
			else {
				if ((rest >> 1) % 2 == 0) {
					result += use_count * choice_odd(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
				}
				else {
					result += use_count * choice_even(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
				}
			}
		}
		return memo_just[n][x] = result % MOD;
	}
	else {
		long long int result = 0;
		for (auto use = 1; use <= n; ++use) {
			const auto rest = n - use;
			const auto not_use = (x >> 1) - use;
			if ((rest >> 1) > not_use) continue;
			const auto use_count = count_just(use, x >> 1);
			if (rest % 2 == 0) {
				if ((rest >> 1) % 2 == 0) {
					result += use_count * choice_odd(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
				else {
					result += use_count * choice_even(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
			}
			else {
				if ((rest >> 1) % 2 == 0) {
					result += use_count * choice_even(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
				else {
					result += use_count * choice_odd(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
			}
			result %= MOD;
		}
		return memo_just[n][x] = result % MOD;
	}
}
long long int count_below(int n, int x) {
	if (n == 1) return 0;
	if (n == 0) return 0;
	if (x == 0) return 0;
	if (n > x - 1) return 0;
	if (memo_below[n][x] >= 0) return memo_below[n][x];
	if (x % 2 == 0) {
		long long int result = 0;
		for (auto use = 1; use <= n; ++use) {
			const auto rest = n - use;
			const auto not_use = (x >> 1) - use - 1;
			if ((rest >> 1) > not_use) continue;
			const auto use_count = count_below(use, x >> 1);
			if (rest % 2 == 0) {
				if ((rest >> 1) % 2 == 0) {
					result += use_count * choice_even(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
				else {
					result += use_count * choice_odd(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
			}
			else {
				if ((rest >> 1) % 2 == 0) {
					result += use_count * choice_odd(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
				else {
					result += use_count * choice_even(use) % MOD * combination(not_use, rest >> 1) % MOD;
				}
			}
			result %= MOD;
		}
		return memo_below[n][x] = result % MOD;
	}
	else {
		long long int result = 0;
		for (auto use = 1; use <= n; ++use) {
			const auto rest = n - use;
			const auto not_use = (x >> 1) - use;
			if ((rest >> 1) > not_use) continue;
			const auto use_below = count_below(use, x >> 1);
			const auto use_just = (count_just(use, x >> 1) - use_below + MOD) % MOD;
			if (rest % 2 == 0) {
				if ((rest >> 1) % 2 == 0) {
					result += use_just * choice_odd(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
					if (not_use > 0) result += use_below * choice_odd(use) % MOD * combination(not_use - 1, rest >> 1) % MOD;
				}
				else {
					result += use_just * choice_even(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
					if (not_use > 0) result += use_below * choice_even(use) % MOD * combination(not_use - 1, rest >> 1) % MOD;
				}
			}
			else {
				if ((rest >> 1) % 2 == 0) {
					result += use_just * choice_even(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
					if (not_use > 0) result += use_below * choice_even(use) % MOD * combination(not_use - 1, rest >> 1) % MOD;
				}
				else {
					result += use_just * choice_odd(use - 1) % MOD * combination(not_use, rest >> 1) % MOD;
					if (not_use > 0) result += use_below * choice_odd(use) % MOD * combination(not_use - 1, rest >> 1) % MOD;
				}
			}
			result %= MOD;
		}
		return memo_below[n][x] = result % MOD;
	}
}
long long int solve(int n, int x) {
	if (x == 0) return 1;
	long long int result = 0;
	for (auto i = 1; i <= n; ++i) {
		const auto count = count_just(i, x);
		for (auto zero = 0; zero + i <= n; ++zero) {
			if ((n - zero - i) % 2 == 1) continue;
			result += count * combination((n - zero - i) / 2 + x - 1, x - 1) % MOD;
			result %= MOD;
		}
	}
	return result;
}
int main() {
	int n, x; std::cin >> n >> x;
	memo_just = memo_below = std::vector<std::vector<long long int>>(500 + 1, std::vector<long long int>(500 + 1, -1));
	factorial = inv_factorial = std::vector<long long int>(1001, 1);
	odd = std::vector<long long int>(501, -1);
	auto inv = factorial;
	for (auto i = 2; i < factorial.size(); ++i) {
		factorial[i] = i * factorial[i - 1] % MOD;
		inv[i] = (MOD - MOD / i) * inv[MOD % i] % MOD;
		inv_factorial[i] = inv[i] * inv_factorial[i - 1] % MOD;
	}
	std::cout << solve(n, x) << '\n';
}



Measured memory_bytes: 6824