// 2011/09/19 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int w, h;
		cin >> w >> h;
		if(w==0&&h==0)
			break;

		int X[100][100];
		for(int x=0; x<w; x++)
			X[0][x] = 1;
		for(int y=0; y<h; y++)
			X[y][0] = 0;
		for(int x=1; x<w; x++)
			X[1][x] = 1;
		for(int y=1; y<h; y++)
			X[y][1] = 1;

		int Y[100][100];
		for(int x=0; x<w; x++)
			Y[0][x] = 0;
		for(int y=0; y<h; y++)
			Y[y][0] = 1;
		for(int x=1; x<w; x++)
			Y[1][x] = 1;
		for(int y=1; y<h; y++)
			Y[y][1] = 1;

		for(int y=2; y<h; y++){
			for(int x=2; x<w; x++){
				X[y][x] = (X[y][x-1]+Y[y-1][x-1])%100000;
				Y[y][x] = (Y[y-1][x]+X[y-1][x-1])%100000;
			}
		}

		cout << (X[h-1][w-1]+Y[h-1][w-1])%100000 << endl;
	}

	return 0;
}