#include <iostream>
using namespace std;

int dp[1001][1001]; // iのj分割の総数

int main() {
  int n, s;
  
  while(cin>>n>>s && (n||s)) {
    if(n>s) {
      cout << 0 << endl;
      continue;
    }
    dp[0][0] = 1;
    for(int j=1; j<=n; j++) {
      for(int i=0; i<=s; i++) {
	if(i-j>=0) {
	  dp[i][j] = dp[i-1][j] + dp[i-j][j];
	} else {
	  dp[i][j] = dp[i][j-1];
	}
      }
    }

    cout << dp[n-1][n-1] << endl;
  }
  
  return 0;
}