program subway(input,output);
var
a:array[0..500,-1..500]of longint;
n,p,i,j,k:longint;
function min(a,b:longint):longint;
begin
if a<b then min:=a else min:=b;
end;
begin
assign(input,'subway.in');assign(output,'subway.out');
reset(input);rewrite(output);
readln(n,p);
a[n,0]:=1;
for i:=n-1 downto 0 do
for j:=min(p,n-i) downto 0 do
a[i,j]:=(a[i+1,j-1]+a[i,j+1])mod 4096;
write(a[0,0]);
close(input);close(output);
end.