program cogs26;
var
m:array[1..11]of integer;
n,k,i,ans:longint;
procedure readin;
var i:integer;
begin
for i:=1 to k do write(m[i],' ');
writeln;
end;
procedure dfs(xx,yy:longint);
var
i:longint;
begin
if(xx=n)then begin inc(ans);readin; exit;end;
for i:=yy downto 1 do
if(m[i]<m[i+1]) then begin
inc(m[i]);
dfs(xx+1,i);
dec(m[i]); end;
end;
begin
assign(input,'dataa.in');reset(input);
assign(output,'dataa.out');rewrite(output);
readln(n,k);
if n=k then begin
for i:=1 to k do write(1,' ');writeln;write(1);exit;end;
dec(n,k);
fillchar(m,sizeof(m),11);
for i:=1 to k do m[i]:=1;
ans:=0;
dfs(0,k);
writeln(ans);
close(input);close(output);
end.