program subway(input,output);
var
i,j,k:longint;
n,p:longint;
f:array [0..500,-1..500] of 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);
f[n,0]:=1;
for i:=n-1 downto 0 do
for j:=min(p,n-i) downto 0 do
f[i,j]:=(f[i+1,j-1]+f[i,j+1]) and 4095;
writeln(f[0,0]);
close(input);
close(output);
end.