var
   a : array[1..10] of longint;
   n,ans,k,nn : longint;
procedure Insert(i,j : longint);
var
   c : longint;
begin
   inc(n);
   for c:=n downto j+1 do a[c]:=a[c-1];
   a[j]:=i;
end;
procedure Delete(i : longint);
var
   c : longint;
begin
   for c:=1 to n do if a[c]=i then break;
   for c:=c to n do a[c]:=a[c+1];
   dec(n);
end;
function br : longint;
var
   i,j : longint;
begin
   i:=1;
   j:=0;
   while i<nn do
     begin
        while (a[i]>a[i+1])and(i<nn) do
           inc(i);
        inc(i);
        inc(j);
     end;
   if a[nn-1]<a[nn] then inc(j);
   br:=j;
end;
procedure rec(l : longint);
var
   i : longint;
begin
   if l<=nn then for i:=1 to l do
      begin
         insert(l,i);
         rec(l+1);
         delete(l);
      end
   else
      begin
//         for i:=1 to nn do write(a[i], ' ');
//         writeln(br);
         if br=k then
            inc(ans);
      end;
end;
begin
   readln(nn,k);
   insert(1,1);
   rec(2);
   writeln(ans);
end.
