#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MAX = 2001;
const ll MOD = 924844033;
int n, k, nxt[2 * MAX], dp[2 * MAX][MAX][2];
ll ans, fact[MAX];
bool mark[2 * MAX], st[2 * MAX];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  fact[0] = 1;
  for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * i % MOD;
  for (int i = 1; i <= n; i++) {
    nxt[i] = (i + k <= n ? n + i + k : -1);
    nxt[n + i] = (i + k <= n ? i + k : -1);
  }
  for (int i = 1, curr = 0; i <= n; i++) {
    if (!mark[i]) {
      mark[i] = true;
      st[++curr] = true;
      for (int v = i; nxt[v] != -1; v = nxt[v]) {
        ++curr;
        mark[nxt[v]] = true;
      }
    }
    if (!mark[n + i]) {
      mark[n + i] = true;
      st[++curr] = true;
      for (int v = n + i; nxt[v] != -1; v = nxt[v]) {
        ++curr;
        mark[nxt[v]] = true;
      }
    }
  }
  dp[0][0][0] = 1;
  for (int i = 1; i <= 2 * n; i++)
    for (int j = 0; j <= n; j++) {
      if (!st[i]) {
        dp[i][j][0] = (dp[i - 1][j][0] + dp[i - 1][j][1]) % MOD;
        if (j) dp[i][j][1] = dp[i - 1][j - 1][0];
      } else
        dp[i][j][0] = (dp[i - 1][j][0] + dp[i - 1][j][1]) % MOD;
    }
  for (int sz = 0; sz <= n; sz++) {
    ans += (sz & 1 ? -1 : 1) * (dp[2 * n][sz][0] + dp[2 * n][sz][1]) *
           fact[n - sz];
    ans %= MOD;
  }
  cout << (ans + MOD) % MOD;
}
