program kb;
var n,k,i,j:longint;
f:array[0..20,0..100] of int64;
procedure work;
begin
f[1,1]:=1; for i:=1 to n do f[i,i]:=1;
i:=2;
while i<=n do
begin
for j:=1 to k do
f[i,j]:=f[i-1,j-1]*(i-j+1)+f[i-1,j]*j;
inc(i);
end;
writeln(f[n,k]);
end;
begin
assign(input,'k.in');reset(input);
assign(output,'k.out');rewrite(output);
readln(n,k);
work;
close(input);close(output);
end.