#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
const int MOD=1e9+7;

int main(){
  ll B,C;
  cin>>B>>C;
  ll minus = C/2;
  if(B < 0 && B-minus < 0){
    ll base;
    if(C%2==0) base = (minus+1)*2-1;
    else base = (minus+1)*2;
    ll sub_minus = (C-1)/2,sub_cnt;
    if((C-1)%2==0) sub_cnt = max(sub_minus*2-1,0ll);
    else sub_cnt = sub_minus*2;
    base += min((-B-1)*2+1, sub_cnt);
    cout << base << endl;
  }else if(B > 0 && B-minus > 0){
    ll base;
    if(C%2==0) base = (minus+1)*2-1;
    else base = (minus+1)*2;
    ll sub_minus = (C-1)/2,sub_cnt;
    if((C-1)%2==0) sub_cnt = max(sub_minus*2-1,0ll);
    else sub_cnt = sub_minus*2;
    cout << base+sub_cnt << endl;
  }else if(B == 0){
    ll r = B+C/2;
    if(C%2==0) cout << r*2 << endl;
    else cout << r*2+1 << endl;
  }else{
    ll r = B+(C-1)/2;
    if((C-1)%2==0) cout << r*2 << endl;
    else cout << r*2+1 << endl;
  }
  return 0;
}

#include "bits/stdc++.h"
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 998244353;
struct mint {
	ll x; // typedef long long ll;
	mint(ll x = 0) :x((x%mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; }
	mint operator+(const mint a) const { return mint(*this) += a; }
	mint operator-(const mint a) const { return mint(*this) -= a; }
	mint operator*(const mint a) const { return mint(*this) *= a; }
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const { return pow(mod - 2); }
	mint& operator/=(const mint a) { return *this *= a.inv(); }
	mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

int main() {
	int N, K;
	cin >> N >> K;
	vector<vector<mint>> dp(N + 1, vector<mint>(N + 1, 0));
	dp[0][0] = 1;
	for (int i = 1; i <= N; ++i) {
		for (int j = N; j >= 0; --j) {
			mint num = 0;
			if (j > 0) {
				num += dp[i - 1][j - 1];
			}
			if (2 * j <= N) {
				num += dp[i][2 * j];
			}
			dp[i][j] = num;
		}
	}
	cout << dp[N][K] << endl;
	return 0;
}