#include <iostream>
using namespace std;
const int MAX_N = 10;
const int MAX_S = 1001;

int n,m;
int dp[MAX_S][MAX_N];

void solve(){
    dp[0][0] = 1;
    for(int i = 1 ; i < MAX_S ; i++){
        for(int j = 0 ; j < MAX_N ; j++){
            if(j-i >= 0){
                dp[i][j] = dp[i-1][j]+dp[i][j-1];
            }
            else{
                dp[i][j] = dp[i-1][j];
            }
        }
    }
}

int main(){
    solve();
    while(cin >> n >> m, n + m){
        cout << dp[m][n]-dp[m][n-1] << endl;
    }
    
    return 0;
}