#include <bits/stdc++.h>
using namespace std;
const long long N = 1001;
const long long M = 998244353;
long long mod(long long m, long long mod = M) {
  m %= mod;
  return (m + mod) % mod;
}
long long dp[N][4][2 * N];
long long n, k;
long long solve(long long i, long long pre, long long cnt) {
  if (i >= n) return (cnt == k);
  long long &tmp = dp[i][pre][cnt];
  if (tmp != -1) return tmp;
  tmp = 0;
  for (long long j = 0; j < 4; j++) {
    if (pre == 3 or pre == 0)
      tmp = mod(tmp + solve(i + 1, j, cnt + (j != pre)));
    else
      tmp = mod(tmp + solve(i + 1, j, cnt + 2 * ((pre ^ j) == 3)));
  }
  return tmp;
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  memset(dp, -1, sizeof dp);
  long long ans = 0;
  for (long long i = 0; i < 4; i++)
    ans = mod(ans + solve(1, i, 1 + (i == 1 or i == 2)));
  cout << ans << '\n';
}
