var
n,m,i,j:longint;
num:array[0..100000]of longint;
f:array[0..1000,0..1000]of longint;
begin
assign(input,'empire.in'); reset(input);
assign(output,'empire.out'); rewrite(output);
readln(n,m);
for i:=1 to 2*n-1 do f[i,0]:=1;
for i:=1 to 2*n-1 do num[i]:=2*((i+1) div 2)-1;
f[1,1]:=1;
for i:=2 to 2*n-1 do
for j:=1 to i-1 do
if i mod 2=1 then
f[i,j]:=(f[i-1,j]+2*f[i-1,j-1] mod 504
+(num[i]-2-(j-1))*f[i-1,j-1] mod 504) mod 504
else f[i,j]:=(f[i-1,j]+(num[i]-(j-1))*f[i-1,j-1]) mod 504;
if m<2*n-1 then writeln(f[2*n-1,m])
else writeln(0);
close(input);
close(output);
end.