#include<iostream>
using namespace std;
#define size 102
#define mod 100000
int dpTate[size][size];
int dpYoko[size][size];
int dpTateOnly[size][size];
int dpYokoOnly[size][size];

int main() {
	int w, h;
	while(cin >> w >> h, w||h) {
		for(int i = 0; i < h+2; i++){
			for(int j = 0; j < w+2; j++){
				dpTate[i][j] = 0;
				dpYoko[i][j] = dpTateOnly[i][j] = dpYokoOnly[i][j]
						= 0;
			}
		}
		
		dpTateOnly[1][1] = dpYokoOnly[1][1] = 1;
		
		for(int i = 1; i < h+1; i++){
			for(int j = 1; j < w+1; j++){
				if(i==1 && j==1) continue;
				dpTate[i][j] = (dpTate[i-1][j] + dpTateOnly[i-1][j]) % mod;
				dpYoko[i][j] = (dpYoko[i][j-1] + dpYokoOnly[i][j-1]) % mod;
				dpTateOnly[i][j] = dpYoko[i-1][j];
				dpYokoOnly[i][j] = dpTate[i][j-1];
			}
		}
		
		cout << (dpTate[h][w] + dpYoko[h][w] + dpTateOnly[h][w] + dpYokoOnly[h][w])
				% mod << endl;
	}
	
	
	
	return 0;
}