#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma comment(linker, "/stack:200000000")

using namespace std;
using namespace __gnu_pbds;

#define fastio ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define pb push_back
#define eb emplace_back 
#define ppb pop_back
#define F first
#define S second
#define gcd __gcd
#define lcm(a, b) (ull(a) / gcd(a, b) * b)
#define sz(x) (int)(x).size()
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define mkp make_pair
#define mkt make_tuple
#define mem(x) memset(x, 0, sizeof(x))
#define deci(x) fixed << setprecision(x)
#define zero(x) setw(x) << setfill('0')
#define EACH(v, u) for(auto& v : u)
#define lowbit(x) (x & -x)
#define dbg(...) cerr << "[" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

typedef uint32_t uint;
typedef int64_t ll;
typedef uint64_t ull;
typedef long double ld;
#define vt vector
#define Q queue
#define pq priority_queue
#define mset multiset
#define uset unordered_set
#define umap unordered_map
#define ar array
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vt<T>, greater<T>>;
template<class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

template<class T, class U> ostream& operator<<(ostream& os, pair<T, U> p) { return os << p.F << " " << p.S; }
template<class T> ostream& operator<<(ostream& os, vt<T> v) { EACH(u, v) os << u << " "; return os; }

template<class T> void read(T& x) { cin >> x; }
template<class T, class... U> void read(T& a, U&... b) { read(a), read(b...); }
template<class T> void write(T x) { cout << x;}
template<class T, class... U> void write(T a, U... b) { write(a), write(" "), write(b...), write("\n"); }

string operator*(string a, int x) { string ret = a; for(int i = 1; i < x; ++i) ret += a; return ret; }
string& operator*=(string& a, int x) { return a = a * x; }

ull fpm(ull a, ull b, ull m) { ull ret = 1;	while(b) { if(b & 1) ret = ret * ret % m; a = a * a % m; b >>= 1; } return ret; }

const int INF(1e9);
const ll LINF(1e17);
const ld pi(3.141592653589793238);

const int d4i[4] = {-1, 0, 1, 0}, d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, -1, 0, 0, 1, 1, 1}, d8j[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

int main() {
	fastio;
	int a, b, c;
	cin >> a >> b;
	if(a == b)
		cout << a << "\n";
	else {
		c = 0 ^ 1 ^ 2 ^ a ^ b;
		cout << c << "\n";
	}
	
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
 
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define len(x) int((x).size())
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define randint(n) uniform_int_distribution<int>(1, (n))(rng)

ll mono[3001][3001];
ll total[3001][3001];
const ll p = 998244353LL;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 
	#ifdef ARTHUR_LOCAL
		ifstream cin("input.txt");
	#endif

	total[0][0]=1LL;
	mono[0][0]=1LL; // really??

	int n,k;
	cin>>k>>n;

	for(int length = 1; length <= k; length++)
	{
		for(int value = 3000; value >= 1; value--)
		{
			mono[length][value] = total[length-1][value-1];

			int val2 = value;

			while(val2 <= 3000)
			{
				total[length][value] += mono[length][val2];
				total[length][value] %= p;

				val2*=2;
			}

			//if(total[length][value]) cout << length << " " << value << " " << total[length][value] << " " << mono[length][value] << endl;
		}
	}

	cout << total[k][n] << "\n";
}