#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
using namespace std;

inline int GetBit(int mask, int num) {
    return (mask >> num) & 1;
}

const int MOD = 924844033;

inline void ModMul(int& x, int y) {
    x = (1LL * x * y) % MOD;
}

inline int GetModMul(int x, int y) {
    ModMul(x, y);
    return x;
}

inline void ModSum(int& x, int y) {
    x += y;
    if (x >= MOD) {
        x -= MOD;
    }
    if (x < 0) {
        x += MOD;
    }
}

inline int GetModSum(int x, int y) {
    ModSum(x, y);
    return x;
}

const int MAX_N = 2e3;

const int MAX_FACT = MAX_N + 1;

int fact[MAX_FACT];

void BuildFact() {
    fact[0] = 1;
    for (int i = 1; i < MAX_FACT; ++i) {
        fact[i] = fact[i - 1];
        ModMul(fact[i], i);
    }
}

void BuildCs(int n, vector<int>& cs) {
    static int buffer[4][MAX_N + 1][MAX_N + 1];

    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j <= n; ++j) {
            for (int t = 0; t <= n; ++t) {
                buffer[i][j][t] = 0;
            }
        }
    }

    buffer[0][1][0] = 1;
    if (n > 1) {
        buffer[2][1][1] = 1;
    }

    for (int i = 1; i < n; ++i) {
        for (int mask = 0; mask < 4; ++mask) {
            for (int c = 0; c <= n; ++c) {
                { // stop
                    int newMask = GetBit(mask, 1);
                    int newC = c;

                    ModSum(buffer[newMask][i + 1][newC], buffer[mask][i][c]);
                }
                if (GetBit(mask, 0) == 0) { // prev
                    int newMask = GetBit(mask, 1);
                    int newC = c + 1;

                    ModSum(buffer[newMask][i + 1][newC], buffer[mask][i][c]);
                }
                if (i + 1 < n) { // next
                    int newMask = GetBit(mask, 1) + 2;
                    int newC = c + 1;

                    ModSum(buffer[newMask][i + 1][newC], buffer[mask][i][c]);
                }
            }
        }
    }

    cs.resize(n + 1);
    for (int c = 0; c <= n; ++c) {
        cs[c] = 0;
        for (int mask = 0; mask < 4; ++mask) {
            ModSum(cs[c], buffer[mask][n][c]);
        }
    }
}

int main() {
    BuildFact();

    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    int k;
    cin >> k;

    vector<int> a;
    for (int i = 0; i < k; ++i) {
        int cur = 0;
        for (int j = i; j < n; j += k) {
            ++cur;
        }
        a.push_back(cur);
    }

    vector<int> dp[2];
    int curPtr = 0;
    dp[curPtr].assign(n + 1, 0);
    dp[curPtr][0] = 1;

    vector<int> cs;
    for (int itr = 0; itr < (int) a.size(); ++itr) {
        BuildCs(a[itr], cs);

        int nxtPtr = 1 - curPtr;
        dp[nxtPtr].assign(n + 1, 0);

        for (int i = 0; i < (int) cs.size(); ++i) {
            for (int j = 0; j <= n; ++j) {
                if (i + j <= n) {
                    ModSum(dp[nxtPtr][i + j], GetModMul(cs[i], dp[curPtr][j]));
                }
            }
        }

        swap(curPtr, nxtPtr);
    }

    int result = 0;
    for (int i = 0; i <= n; ++i) {
        int cur = dp[curPtr][i];
        if (i & 1) {
            cur = GetModSum(0, -cur);
        }
        ModSum(result, GetModMul(cur, fact[n - i]));
    }

    cout << result << endl;

    return 0;
}

Measured memory_bytes: 62848