while True: try: m,n = map(int,input().split()) # m为行数,n为列数 c = [[1 for i in range(n+1)] for j in range(m+1)] # 隐含了边界条件初始化 for i in range(1,m+1): # 转换为求解从右下角走到左上角的路径数 for j in range(1,n+1): c[i][j] = c[i-1][j] + c[i][j-1] print(c[m][n]) except: break