/*
_/_/_/_/    _/_/_/_/_/  _/_/_/
_/      _/      _/    _/      _/
_/      _/      _/    _/      _/
_/      _/      _/    _/      _/
_/      _/      _/    _/  _/  _/
_/      _/  _/  _/    _/    _/_/
_/_/_/_/      _/_/     _/_/_/_/_/

_/_/_/_/    _/    _/  _/      _/
_/      _/   _/  _/   _/_/  _/_/
_/      _/    _/_/    _/ _/_/ _/
_/      _/     _/     _/  _/  _/
_/      _/    _/_/    _/      _/
_/      _/   _/  _/   _/      _/
_/_/_/_/    _/    _/  _/      _/

_/_/_/_/_/ _/_/_/_/_/ _/_/_/_/_/
    _/         _/     _/
    _/         _/     _/
    _/         _/     _/_/_/_/
    _/         _/     _/
    _/         _/     _/
    _/     _/_/_/_/_/ _/_/_/_/_/

_/_/_/_/_/ _/_/_/_/_/ _/_/_/_/_/
    _/         _/     _/
    _/         _/     _/
    _/         _/     _/_/_/_/
    _/         _/     _/
    _/         _/     _/
    _/     _/_/_/_/_/ _/_/_/_/_/
*/
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>

#include <algorithm>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <iomanip>
#include <limits>
#include <numeric>

#define LOG(FMT...) fprintf(stderr, FMT)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template<class T>
istream &operator>>(istream &is, vector<T> &v) {
  for (T &x : v)
    is >> x;
  return is;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  if (!v.empty()) {
    os << v.front();
    for (int i = 1; i < v.size(); ++i)
      os << ' ' << v[i];
  }
  return os;
}

const int P = 998244353;

int norm(int x) { return x >= P ? (x - P) : x; }

void add(int &x, int y) { if ((x += y) >= P) x -= P; }

void sub(int &x, int y) { if ((x -= y) < 0) x += P; }

void exGcd(int a, int b, int &x, int &y) {
  if (!b) {
    x = 1;
    y = 0;
    return;
  }
  exGcd(b, a % b, y, x);
  y -= a / b * x;
}

int inv(int a) {
  int x, y;
  exGcd(a, P, x, y);
  return norm(x + P);
}

const int N = 3010, L = 15;

int A[L], B[L];
int f[L][N];
int q[N];

int main() {
#ifdef ELEGIA
  freopen("test.in", "r", stdin);
  int nol_cl = clock();
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int n, k;
  cin >> n >> k;
  n -= k;

  for (int i = 1; i != L; ++i) {
    B[i] = (1 << i) - 1;
    A[i] = A[i - 1] + B[i];
  }

  {
    q[0] = 1;
    int C = 0;
    for (int i = 0; C <= n; ++i, C = A[i] + k * ((1 << i) - 1)) {
      if (i)
        for (int j = B[i]; j <= n - C; ++j) add(q[j], q[j - B[i]]);
      if (i & 1)
        for (int j = C; j <= n; ++j) sub(f[0][j], q[j - C]);
      else for (int j = C; j <= n; ++j) add(f[0][j], q[j - C]);
    }
  }

  for (int i = 0; i <= n; ++i) {
    for (int j = 1; A[j] <= i; ++j)
      sub(f[0][i], f[j][i - A[j]]);
    int j;
    for (j = 1; B[j] <= i; ++j)
      f[j][i] = norm(P - f[j - 1][i] + f[j][i - B[j]]);
    for (; B[j] <= n; ++j)
      f[j][i] = norm(P - f[j - 1][i]);
  }

  cout << f[0][n] << '\n';

#ifdef ELEGIA
  LOG("Time: %dms\n", int ((clock()
          -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
  return 0;
}

//#include<cstdio>
//#include<cassert>
//#include<iostream>
//#include<cstring>
//#include<algorithm>
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define MAX ((int)2e9 + 5)
#define MAXP ((int)2e5)
#define MAXL ((ll)1e18 + 5)
#define MAX_X ((ll)1e5 + 2)
#define pi acos(-1)
#define M ((int)1e6 + 7)
#define MOD ((int)998244353 + 0)
//#define MOD1 ((int)998244353 + 0)
#define BAS ((int)1e6 + 3)
#define BAS1 ((int)2e5 + 3)
#define NN ((int)1e5 + 5)
#define N ((int)3e3 + 5)
#define eps (1e-8)
#define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
#define logn 10
#define endl "\n"
#define mp make_pair
#define BUCK 105
#define LEF (idx<<1)
#define RIG ((idx<<1)|1)
//#define int ll


using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;

/*fast io
ios_base::sync_with_stdio(false);
cin.tie(NULL);
*/




typedef tree < int,  null_type,  less < int >,  rb_tree_tag,  tree_order_statistics_node_update > o_set;
typedef tree < pair < int, int >,  null_type,  less < pair < int, int > >,  rb_tree_tag,  tree_order_statistics_node_update > o_setp;
/// o_set s;
/// s.order_of_key(k) : Number of items strictly smaller than k .
/// *(s.find_by_order(k)) : K-th element in a set (counting from zero).

int dpp[N][N] , sum[N][N];

int call(int last , int rem);

int fun(int last , int rem)
{
    last = min(last , rem);
    if(rem < 0) return 0;
    if(sum[last][rem] != -1) return sum[last][rem];
    int ans = call(last,rem) + fun(last + 2 , rem-1);
    if(ans >= MOD) ans -= MOD;
    return sum[last][rem] = ans;
}

int call(int last , int rem)
{
    last = min(last , rem);
    if(rem < 0) return 0;
    if(rem == 0) return 1;
    if(dpp[last][rem] != -1) return dpp[last][rem];
    int ans = fun(2,rem-1) - fun(last+last+2,rem-last-1);
    if(ans < 0) ans += MOD;
    return dpp[last][rem] = ans;
}

int main()
{
    fastio;
    int n , k;
    cin>>n>>k;
    memset(dpp,-1,sizeof dpp);
    memset(sum,-1,sizeof sum);
    cout<<call(k,n-k)<<endl;
    return 0;
}
