#include <bits/stdc++.h>


using namespace std;


#ifdef zxc

#include <sys/resource.h>
#include "debug.h"

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

using ll = int64_t;
using ld = long double;
const ld EPS = 1e-10;
const ll MOD = 924844033;
const ld PI = 3.141592653589793;
const int maxn = 300001;

void fast_io() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

struct pt {
    ld x, y;

    pt operator+(const pt &rhs) {
        return {x + rhs.x, y + rhs.y};
    }

    pt operator-(const pt &rhs) {
        return {x - rhs.x, y - rhs.y};
    }

    ld norm() {
        return hypotl(x, y);
    }

    pt operator*(ld v) {
        return {x * v, y * v};
    }
};

bool close_dbl(ld a, ld b) {
    return abs(a - b) < EPS;
}

bool less_dbl(ld a, ld b) {
    return a < b && !close_dbl(a, b);
}

bool less_equal_dbl(ld a, ld b) {
    return a < b || close_dbl(a, b);
}

int close_lg(int n) { return n > 1 ? 32 - __builtin_clz(n - 1) : 0; }

ll add(ll a, ll b) {
    a += b;
    if (a >= MOD) {
        a -= MOD;
    }
    return a;
}

ll mul(ll a, ll b, ll m) {
    return a * b % m;
}

ll pw(ll a, ll b, ll m) {
    ll res = 1;
    for (; b; b >>= 1) {
        if (b & 1) {
            res = mul(res, a, m);
        }
        a = mul(a, a, m);
    }
    return res;
}

ll fac[2001];

ll pw(ll a, ll b) {
    ll res = 1;
    for (; b; b >>= 1) {
        if (b & 1) res = res * a % MOD;
        a = a * a % MOD;
    }
    return res;
}

vector<int> chains[4001];
int chain_dp[2][4001][2];
vector<int> chain_count[4001];
int dp[4001][2001];
int used[4001];

signed main() {
#ifdef zxc
    struct rlimit rl;
    const rlim_t kStackSize = 512L * 1024L * 1024L;
    assert(!getrlimit(RLIMIT_STACK, &rl));
    rl.rlim_cur = kStackSize;
    assert(!setrlimit(RLIMIT_STACK, &rl));
    freopen("../kolya_input.txt", "r", stdin);
//    freopen("../kolya_output.txt", "w", stdout);
#else
    //    mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    //            freopen("", "r", stdin);
    //        freopen("hack.out", "w", stdout);
#endif
    fast_io();
    cout.precision(9);
    cout << fixed;
    auto start = chrono::steady_clock::now();
    int n;
    int k;

    cin >> n;
    cin >> k;
    fac[0] = 1;
    for (int i = 1; i <= n; ++i) {
        fac[i] = 1ll * fac[i - 1] * i % MOD;
    }

    int chain_cnt = 0;
    for (int i = 1; i <= n; ++i) {
        int cur = i;
        if (used[cur]) {
            continue;
        }
        while (cur <= n) {
            used[cur] = 1;
            chains[chain_cnt].push_back(cur);
            chains[chain_cnt + 1].push_back(cur);
            cur += k;
        }
        debug(chains[chain_cnt]);
        debug(chains[chain_cnt + 1]);
        chain_cnt += 2;
    }
    for (int i = 0; i < chain_cnt; ++i) {
        memset(chain_dp[0], 0, sizeof(chain_dp[0]));
        memset(chain_dp[1], 0, sizeof(chain_dp[1]));
        chain_dp[0][0][0] = 1;
        for (int e = 0; e + 1 < chains[i].size(); ++e) {
            int cur_ind = e & 1;
            int nxt_ind = cur_ind ^1;
            for (int k = 0; k <= e; ++k) {
                chain_dp[nxt_ind][k][0] = chain_dp[cur_ind][k][0] + chain_dp[cur_ind][k][1];
                if (chain_dp[nxt_ind][k][0] >= MOD) {
                    chain_dp[nxt_ind][k][0] -= MOD;
                }
                chain_dp[nxt_ind][k + 1][1] = chain_dp[cur_ind][k][0];
            }
        }
        chain_count[i].resize(chains[i].size());
        for (int e = 0; e < chains[i].size(); ++e) {
            chain_count[i][e] = chain_dp[(chains[i].size() & 1) ^ 1][e][0] + chain_dp[(chains[i].size() & 1) ^ 1][e][1];
            if (chain_count[i][e] >= MOD) {
                chain_count[i][e] -= MOD;
            }
        }
        debug(i, chain_count[i]);
    }
    dp[0][0] = 1;
    for (int i = 0; i < chain_cnt; ++i) {
        for (int size = 0; size <= n; ++size) {
            for (int e = 0; e < chain_count[i].size(); ++e) {
                dp[i + 1][size + e] += 1ll * dp[i][size] * chain_count[i][e] % MOD;
                if (dp[i + 1][size + e] >= MOD) {
                    dp[i + 1][size + e] -= MOD;
                }
            }
        }
    }
    vector<ll> match_cnt(n + 1);
    for (int i = 0; i <= n; ++i) {
        match_cnt[i] = dp[chain_cnt][i];
    }
    debug(match_cnt);
    ll ans = 0;
    for (int i = 0; i <= n; ++i) {
        ll sign = i & 1 ? (MOD - 1) : 1;
        ans += 1ll * fac[n - i] * sign % MOD * match_cnt[i] % MOD;
        if (ans >= MOD) {
            ans -= MOD;
        }
    }
    cout << ans;
    auto end = chrono::steady_clock::now();

    debug("time", chrono::duration_cast<chrono::milliseconds>(end - start).count() / 1000.0);

}



Measured memory_bytes: 32000