#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <cstdio>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <random>
#include <iomanip>
#include <bitset>
 
 
using namespace std;
 
template<typename T> void uin(T &a, T b) {
    if (b < a) {
        a = b;
    }
}
 
template<typename T> void uax(T &a, T b) {
    if (b > a) {
        a = b;
    }
}

#define int long long
#define left left228
#define right right228
#define prev prev228
#define list list228
#define mp make_pair
#define all(v) v.begin(), v.end()
#define forn(i, n) for (int i = 0; i < (int)n; ++i)
#define firn(i, n) for (int i = 1; i < (int)n; ++i)
#define x first
#define y second

const int N = 4007;
const int MOD = 924844033;

void add(int &a, int b) {
    a += b;
    if (a >= MOD) a -= MOD;
}
int addi(int a, int b) {
    add(a, b); return a;
}
void mul(int &a, int b) {
    a *= b, a %= MOD;
}
int mult(int a, int b) {
    mul(a, b); return a;
}
int mod(int x) {
    x %= MOD;
    if (x < 0) x += MOD;
    return x;
}

vector<int> g[N * 2];
int M[N], dp[N];
int f[N][N], F[N], deg[N];
bool used[N];

int sum_deg = 0, len = 0;

void dfs(int v) {
    used[v] = 1;
    sum_deg += deg[v];
    ++len;
    for (int to : g[v]) {
        if (!used[to]) {
            dfs(to);
        }
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; ++i) {
        if (i - k > 0) {
            g[i].push_back(n + i - k); g[n + i - k].push_back(i);
            ++deg[i], ++deg[n + i - k];
        }
        if (i + k <= n) {
            g[i].push_back(n + i + k); g[n + i + k].push_back(i);
            ++deg[i], ++deg[n + i + k];
        }
    }
    f[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        f[i][0] = 1;
    }
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= n; ++j) {
            f[i][j] = f[i - 1][j];
            if (i > 1) {
                add(f[i][j], f[i - 2][j - 1]);
            }
        }
    }
    int s = 0;
    dp[0] = 1;
    for (int iv = 1; iv <= n; ++iv) {
        if (!used[iv]) {
            sum_deg = len = 0;
            dfs(iv);
            // cout << "len=" << len << " sum_deg=" << sum_deg << endl;
            vector<int> dp1(s + 1);
            for (int i = 0; i <= s; ++i) {
                dp1[i] = dp[i];
            }
            vector<int> dp2(len + 1);
            if (sum_deg == 2 * len) {
                for (int i = 1; i <= len; ++i) {
                    dp2[i] = addi(f[len - 1][i], f[len - 3][i - 1]);
                }
            } else {
                for (int i = 0; i <= len; ++i) {
                    dp2[i] = f[len][i];
                }
            }
            dp2[0] = 1;
            for (int i = 0; i <= s + len; ++i) {
                dp[i] = 0;
            }
            for (int i = 0; i <= s; ++i) {
                for (int j = 0; j <= len; ++j) {
                    dp[i + j] = mod(dp[i + j] + mult(dp1[i], dp2[j]));
                }
            }
            s += len;
        }
    }
    F[0] = 1;
    M[0] = dp[0];
    for (int i = 1; i <= n; ++i) {
        F[i] = mult(F[i - 1], i);
        M[i] = dp[i];
    }
    // for (int i = 0; i <= n; ++i) {
    //     cout << "M[" << i << "]=" << M[i] << '\n';
    // }
    int res = 0;
    for (int i = 0; i <= n; ++i) {
        int z = 1;
        if (i & 1) z = -1;
        res = mod(res + z * M[i] * F[n - i]);
    }
    cout << res << '\n';
    return 0;
}

Measured memory_bytes: 63360