var f:array[0..100,0..100] of longint;
n,m,i,j,k,sum:longint;
begin
assign(input,'p1008.in'); assign(output,'p1008.out');
reset(input); rewrite(output);
readln(n,m);
f[0,1]:=1;
for i:=1 to m do
for j:=1 to n do
begin
if j=1 then
f[i,j]:=f[i-1,n]+f[i-1,j+1]
else if j=n then
f[i,j]:=f[i-1,1]+f[i-1,j-1]
else
f[i,j]:=f[i-1,j-1]+f[i-1,j+1];
end;
writeln(f[m,1]);
close(input); close(output);
end.