program subway2;
const
fin='subway.in';
fou='subway.out';
var
f:array[0..500,0..300]of longint;
n,p,i,j:longint;
f1,f2:text;
procedure init;
begin
assign(f1,fin);
assign(f2,fou);
reset(f1); rewrite(f2);
read(f1,n,p);
f[n,0]:=1;
end;
procedure main;
begin
for i:=n-1 downto 0 do
for j:=p downto 0 do
begin
if j+1<=p then f[i,j]:=f[i,j+1];
if j-1>=0 then f[i,j]:=(f[i,j]+f[i+1,j-1]) mod 4096;
end;
end;
begin
init;
main;
write(f2,f[0,0]);
close(f1); close(f2);
end.