#include "bits/stdc++.h"
using namespace std;
const int N = 5e3 + 3;
const int mod = 1988;
inline int add(int a , int b){
int res = a + b;
if(res >= mod){
return res - mod;
}
return res;
}
int n , k;
int dp1[N][N];
int dp2[N][N];
void pre(){
for(n = 0 ; n < N ; ++n){
dp1[n][1] = 1;
dp2[n][1] = add(((n >= 2) ? dp2[n - 2][1] : 0) , dp1[n][1]);
for(k = 2 ; k < N ; ++k){
dp1[n][k] = dp2[n][k - 1];
dp2[n][k] = add(((n > k) ? dp2[n - k - 1][k] : 0) , dp1[n][k]);
}
}
}
int main(){
pre();
while(~scanf("%d %d" , &n , &k)){
if(n + k){
printf("%d\n" , dp1[n - k][k]);
}
}
}
I2luY2x1ZGUgImJpdHMvc3RkYysrLmgiCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmNvbnN0IGludCBOID0gNWUzICsgMzsKY29uc3QgaW50IG1vZCA9IDE5ODg7CmlubGluZSBpbnQgYWRkKGludCBhICwgaW50IGIpewogICAgaW50IHJlcyA9IGEgKyBiOwogICAgaWYocmVzID49IG1vZCl7CiAgICAgICAgcmV0dXJuIHJlcyAtIG1vZDsKICAgIH0KICAgIHJldHVybiByZXM7Cn0KaW50IG4gLCBrOwppbnQgZHAxW05dW05dOwppbnQgZHAyW05dW05dOwp2b2lkIHByZSgpewogICAgZm9yKG4gPSAwIDsgbiA8IE4gOyArK24pewogICAgICAgIGRwMVtuXVsxXSA9IDE7CiAgICAgICAgZHAyW25dWzFdID0gYWRkKCgobiA+PSAyKSA/IGRwMltuIC0gMl1bMV0gOiAwKSAsIGRwMVtuXVsxXSk7CiAgICAgICAgZm9yKGsgPSAyIDsgayA8IE4gOyArK2spewogICAgICAgICAgICBkcDFbbl1ba10gPSBkcDJbbl1bayAtIDFdOwogICAgICAgICAgICBkcDJbbl1ba10gPSBhZGQoKChuID4gaykgPyBkcDJbbiAtIGsgLSAxXVtrXSA6IDApICwgZHAxW25dW2tdKTsKICAgICAgICB9CiAgICB9Cn0KaW50IG1haW4oKXsKICAgIHByZSgpOwogICAgd2hpbGUofnNjYW5mKCIlZCAlZCIgLCAmbiAsICZrKSl7CiAgICAgICAgaWYobiArIGspewogICAgICAgICAgICBwcmludGYoIiVkXG4iICwgZHAxW24gLSBrXVtrXSk7CiAgICAgICAgfQogICAgfQp9