program t2;
var
n,m,i,j:integer;
ans2,zong:double;
ans:double;
f:array[0..20,0..20] of int64;
begin
assign(input,'lottery.in');
reset(input);
assign(output,'lottery.out');
rewrite(output);
readln(n,m);
if n>m
then writeln('0.0000')
else
begin
zong:=1;
for i:=1 to m do
zong:=zong*n;
if n=m then
begin
ans2:=1;
for i:=2 to n do
ans2:=ans2*i;
ans:=ans2/zong;
writeln(ans:0:4)
end
else
begin
fillchar(f,sizeof(f),0);
for j:=1 to m do
f[1,j]:=1;
for i:=2 to n do
for j:=1 to m do
if i<=j
then f[i,j]:=f[i,j-1]*i+f[i-1,j-1]*i;
ans:=f[n,m]/zong;
writeln(ans:0:4)
end
end;
close(input);
close(output)
end.