//* Problem  : B - Binomial Showdown
//* Contest  : UzhNU Local
//* Origin   : Ulm-1997
//* Type     : Solution
//* Date     : 2008.02.04
//* Author   : alt
//* Language : C++
//* Compiler : Microsoft Visual C++ 6.0
//* Algoritm : Factorizing

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#define int64 long long

int n, k, res;

int cnt[100000];

void factorize(int n, int d)
{
	int k;
	for (k = 2; (k * k <= n) && (n > 1); k++)
		while (n % k == 0)
		{
			cnt[k]+=d;
			n /= k;
		}
	if (n != 1) cnt[n]+=d;
}

void solve()
{
	if (!k || k == n) {res = 1; return;}
	if (k == 1 || k == n - 1) {res = n; return;}
	if (k == 2 || k == n - 1)
	{
		if (n % 2)
			res = (n - 1) / 2 * n;
		else
			res = n / 2 * (n - 1);
		return;
	}
	//memset(cnt, 0, sizeof(cnt));
	int i;
	for (i = 2; i <= n; i++)
		factorize(i, +1);
	for (i = 2; i <= n-k; i++)
		factorize(i, -1);
	for (i = 2; i <= k; i++)
		factorize(i, -1);
	res = 1;
	for (i = 2; i <= n; i++)
		while (cnt[i])
		{
			res *= i;
			cnt[i]--;
		}
	//return res;
}

int main()
{
	int nt = 0;
	while (1)
	{
		scanf("%d%d", &n, &k); if (!n) break;
		solve();
		printf("%d\n", res);
	}
	return 0;
}