#include <iostream>
using namespace std;

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

int main() {
  int n, m;
  
  while(cin>>m>>n && (m||n)) {
    if(m>n) {
      cout << 0 << endl;
      continue;
    }
    dp[0][0] = 1;

    for(int i=1; i<=m; i++) {
      for(int j=0; j<=n; j++) {
	if(j-i>=0) {
	  dp[i][j] = dp[i-1][j] + dp[i][j-i];
	} else {
	  dp[i][j] = dp[i-1][j];
	}
      }
    }
    
    cout << dp[m][n] - dp[m-1][n] << endl;
  }
  
  return 0;
}