{$N+}

const
  NMAX = 100;
  MMAX = 3;

var
  N,M: Integer;
  k,i: Integer;
  s: array[0..NMAX] of String;

function mult(a,b:String):String;
var
 i,j,k,len: Integer;
 r: String;
 x: Integer;
begin
 while length(a)<length(b) do a:='0'+a;
 while length(b)<length(a) do b:='0'+b;
 len:=length(a);
 r[0]:=chr(length(a)*2);
 for i:=1 to 2*len do r[i]:='0';
 x:=0;
 for j:=len downto 1 do
 begin
  for i:=len downto 1 do begin
   k:=2*len+3-(len-i+1)-(len-j+1)-1;
   x:=x+(ord(b[j])-ord('0'))*(ord(a[i])-ord('0'))+(ord(r[k])-ord('0'));
   r[k]:=chr(ord('0')+ x mod 10);
   x:=x div 10;
  end;
  k:=k-1;
  while x>0 do begin
   x:=x+(ord(r[k])-ord('0'));
   r[k]:=chr(ord('0')+ x mod 10);
   x:=x div 10;
   k:=k-1;
  end;
 end;
 while r[1]='0' do delete(r,1,1);
 mult:=r;
end;

function smult(M: Integer; s: String): String;
var 
  i,r: Integer;
begin
  r:=0;
  for i:=length(s) downto 1 do 
  begin
   r:=r+(ord(s[i])-ord('0'))*M;
   s[i]:=chr((r mod 10) + ord('0'));
   r:=r div 10;
  end;
  if r>0 then s:=chr((r mod 10) + ord('0')) + s;
  while s[1]='0' do delete(s,1,1);
  smult := s;
end;

function sum(s1,s2: String):String;
var
 i:Integer;
 r:Integer;
begin
 while length(s1)<length(s2) do s1:='0'+s1;
 while length(s2)<length(s1) do s2:='0'+s2;
 r:=0;
 for i:=length(s1) downto 1 do
 begin
   r:=r+(ord(s1[i])-ord('0'))+(ord(s2[i])-ord('0'));
   s1[i]:=chr((r mod 10) + ord('0'));
   r:=r div 10;
 end;
 if r>0 then s1:=chr((r mod 10) + ord('0')) + s1;
 while s[1]='0' do delete(s1,1,1);
 sum := s1;
end;

begin
//  assign(input,'input.txt');
  reset(input);
//  assign(output,'output.txt');
  rewrite(output);
  readln(N,M);
  if odd(N) then begin
    writeln(0);
    exit;
  end;
  N := N div 2;
  fillchar(s,sizeof(s),0);
  s[0]:='1';
  for k:=1 to N do
    for i:=1 to k do s[k]:=sum(s[k],smult(M,mult(s[i-1],s[k-i])));

  writeln(s[N]);

end.
