program ex(f1,f2);
type
zn=array [1..505] of longint;
var
f:zn; f1,f2:text; i,j,k,l,p,m,n:longint;
begin
assign(f1,'subway.in'); reset(f1);
assign(f2,'subway.out'); rewrite(f2);
readln(f1,n,m);
if n<=m then
begin
f[1]:=1;
for i:=2 to n do f[i]:=(f[i-1]*i) mod 4096;
writeln(f2,f[n]);
end
else
begin
f[1]:=1;
for i:=2 to m do f[i]:=(f[i-1]*i) mod 4096;
for i:=m+1 to n do f[i]:=(f[i-1]*2) mod 4096;
writeln(f2,f[n]);
end;
close(f1);
close(f2);
end.