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