#include <stdio.h>
#include <string.h>

int dp[4][100][100];

//0 ツ債カツつゥツづァツ猟按づ篠淞づ可凝按つェツづェツづゥ
//1 ツ債カツつゥツづァツ猟按づ篠淞づ可凝按つェツづェツづ按つ「
//2 ツ可コツつゥツづァツ猟按づ篠淞づ可凝按つェツづェツづゥ
//3 ツ可コツつゥツづァツ猟按づ篠淞づ可凝按つェツづェツづ按つ「


int main(void)
{
	int w, h;
	
	while (1){
		memset(dp, 0, sizeof(dp));
		
		scanf("%d%d", &w, &h);
		if (w == 0 && h == 0){
			break;
		}
		
		for (int i = 1; i < w; i++){
			dp[0][i][0] = 1;
		}
		for (int i = 1; i < h; i++){
			dp[2][0][i] = 1;
		}
		
		for (int y = 1; y < h; y++){
			for (int x = 1; x < w; x++){
				dp[0][x][y] = (dp[0][x - 1][y] + dp[1][x - 1][y]) % 100000;
				dp[1][x][y] = dp[2][x - 1][y] % 100000;
				dp[2][x][y] = (dp[2][x][y - 1] + dp[3][x][y - 1]) % 100000;
				dp[3][x][y] = dp[0][x][y - 1] % 100000;
			}
		}
		
		printf("%d\n", (dp[0][w - 1][h - 1] + dp[1][w - 1][h - 1] + dp[2][w - 1][h - 1] + dp[3][w - 1][h - 1]) % 100000);
	}
	
	return (0);
}