{
Written by Fyodor Menshikov 07.02.2004
12:24-12:39
Works 1s with full checks on IC400/TP7
}
{$R+,Q+,S+}
const
   maxn=100;
   maxm=3;
   numlen=60;
type
   number=array[1..numlen]of byte;

   procedure set0(var n:number);
   var
      i:integer;
   begin
      for i:=1 to high(n) do
         n[i]:=0;
   end;

   procedure set1(var n:number);
   begin
      set0(n);
      n[1]:=1;
   end;

   procedure add(var n1:number;n2:number);
   var
      i,c:integer;
   begin
      c:=0;
      for i:=1 to high(n1) do begin
         c:=c+n1[i]+n2[i];
         n1[i]:=c mod 10;
         c:=c div 10;
      end;
      if c<>0 then
         halt(1);
   end;

   procedure mulshort(var n:number;by:integer);
   var
      i,c:integer;
   begin
      c:=0;
      for i:=1 to high(n) do begin
         c:=c+n[i]*by;
         n[i]:=c mod 10;
         c:=c div 10;
      end;
      if c<>0 then
         halt(1);
   end;

   function len(n:number):integer;
   var
      i:integer;
   begin
      len:=1;
      for i:=1 to high(n) do
         if n[i]<>0 then
            len:=i;
   end;

   procedure mullong(n1,n2:number;var n3:number);
   var
      i1,i2,i3,len1,len2,c:integer;
   begin
      len1:=len(n1);
      len2:=len(n2);
      if len1+len2>high(n3) then
         halt(1);
      set0(n3);
      for i1:=1 to len1 do
         for i2:=1 to len2 do begin
            i3:=i1+i2-1;
            c:=n1[i1]*n2[i2];
            while c<>0 do begin
               c:=c+n3[i3];
               n3[i3]:=c mod 10;
               c:=c div 10;
               inc(i3);
            end;
         end;
   end;

   procedure show(n:number);
   var
      i:integer;
   begin
      for i:=len(n) downto 1 do
         write(n[i]);
      writeln;
   end;

var
   count:array[0..maxn]of number;
   sum,t:number;
   i,n,nn,m:integer;
begin
//   assign(input,'input.txt');
   reset(input);
//   assign(output,'output.txt');
   rewrite(output);
   readln(n,m);
   if odd(n) then begin
      writeln(0);
      halt;
   end;
   if (n<1)or(n>maxn)or(m<1)or(m>maxm) then
      halt(1);
   set1(count[0]);
   nn:=n;
   for n:=1 to nn do begin
      if odd(n) then
         continue;
      set0(sum);
      for i:=2 to n do begin
         mullong(count[i-2],count[n-i],t);
         mulshort(t,m);
         add(sum,t);
      end;
      count[n]:=sum;
   end;
   show(count[nn]);
end.