#include<iostream>
using namespace std;

#define MAX_N 10
#define MAX_M 1000
#define MAX_S 1100

long long x[MAX_N][MAX_M][MAX_S], y[MAX_N][MAX_S];
int main() {
	x[0][0][0] = 1; x[1][0][0] = 1;
	for (int i = 1; i < MAX_N; i++) {
		for (int j = 0; j < MAX_M; j++) {
			for (int k = 0; k < MAX_S; k++) {
				if (x[i - 1][j][k] >= 1) {
					for (int l = j + 1; l < MAX_M; l++) {
						if (k + l > MAX_S) { break; }
						x[i][l][k + l] += x[i - 1][j][k];
					}
				}
			}
		}
	}
	for (int i = 0; i < MAX_N; i++) {
		for (int j = 0; j < MAX_M; j++) {
			for (int k = 0; k < MAX_S; k++) {
				y[i][k] += x[i][j][k];
			}
		}
	}
	int a, b;
	while (true) {
		cin >> a >> b;
		if (!a && !b) { break; }
		cout << y[a][b];
	}
}