import java.util.Scanner; public class Main { static int INF = 2 << 27; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int ans = dfs(0,K,new int[N],new boolean[N],false); System.out.println(ans); } static int dfs(int a, int b, int[] c, boolean[] d, boolean e) { if(a == 0) { c[a] = b; d[b-1] = true; return dfs(a+1,b,c,d,e); } if(a == c.length) { if(e) return 1; return 0; } int ret = 0; for(int i = 0; i < c.length; i++) { if(d[i]) continue; boolean nex = e; if(c[a-1] > i+1) { if(e) continue; nex = true; } c[a] = i+1; d[i] = true; ret += dfs(a+1,b,c,d,nex); c[a] = 0; d[i] = false; } return ret; } }