program subway(input,output);
var
i,j,k:longint;
n,p:longint;
ans,temp:int64;
begin
assign(input,'subway.in');
assign(output,'subway.out');
reset(input);
rewrite(output);
readln(n,p);
if n=1 then writeln('1');
ans:=1;
temp:=1;
if p>=n then begin
for i:=1 to n do temp:=temp*i mod 4096;
writeln(temp);
end
else
begin
if p<>1 then
begin
for i:=1 to p
do ans:=ans*i mod 4096;
for i:=1 to n-p
do ans:=ans*2 mod 4096;
end;
writeln(ans);
end;
close(input);
close(output);
end.