#include <bits/stdc++.h>
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int mod = 998244353, N = 2e3 + 100;
int k, n;
inline int add(int x) { return x >= mod ? x - mod : x; }
namespace sub0 {
int dp[N][N];
inline int work() {
  for (int i = 1; i <= n; ++i) dp[i][i] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = n, sum = 0; j >= 1; --j) {
      sum = add(sum + dp[i][j]);
      if (i + j <= n) dp[i + j][j] = add(dp[i + j][j] + sum);
    }
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) ans = add(ans + dp[i][j]);
  return ans;
}
}  // namespace sub0
namespace sub1 {
std::vector<int> dp[N][N];
inline int work() {
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) dp[i][j].resize(n / j + 1);
  for (int i = 1; i <= n; ++i) dp[i][1][i] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      for (int k = n / j, sum = 0; k >= 1; --k) {
        sum = add(sum + dp[i][j][k]);
        int t = i + (j + 1) * k;
        if (t <= n) dp[t][j + 1][k] = add(dp[t][j + 1][k] + sum);
      }
  int ans = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      for (int k = n / j; k >= 1; --k) ans = add(ans + dp[i][j][k]);
  return ans;
}
}  // namespace sub1
namespace sub2 {
const int N = 64;
int ans;
std::vector<int> a;
inline bool unfold(std::vector<int>& a) {
  std::vector<int> b;
  int m = a.size(), sum = 0;
  for (int i = 1; i <= m; ++i) {
    sum += i * a[i - 1];
    if (sum > n) return 0;
  }
  for (int i = m; i >= 1; --i) {
    int T = a[i - 1];
    while (T--) b.push_back(i);
  }
  a = b;
  return 1;
}
inline bool check() {
  int T = k - 1;
  std::vector<int> b = a;
  while (T--)
    if (!unfold(b)) return 0;
  return 1;
}
inline void dfs(int rest, int las) {
  if (check())
    ++ans;
  else
    return;
  for (int i = 1; i <= las && i <= rest; ++i) {
    a.push_back(i);
    dfs(rest - i, i);
    a.pop_back();
  }
}
inline int work() {
  for (int i = 1; i <= N; ++i) {
    a.push_back(i);
    dfs(N - i, i);
    a.pop_back();
  }
  return ans;
}
}  // namespace sub2
int main() {
  n = read();
  k = read();
  if (k == 1)
    printf("%d\n", sub0::work());
  else if (k == 2)
    printf("%d\n", sub1::work());
  else
    printf("%d\n", sub2::work());
  return 0;
}
