#include <iostream>
#include <cstring>

using namespace std;

#define MOD 100000

int main(void){
	int w,h;
	
	while(cin >> w >> h){
		if((w|h) == 0) break;
		int dpr[h][w];
		int dpu[h][w];
		memset(dpr, 0, sizeof(dpr));
		memset(dpu, 0, sizeof(dpu));
		dpr[0][0] = 1;
		dpu[0][0] = 1;
		
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				if((i|j) == 0){
					dpr[0][1] = 1;
					dpu[1][0] = 1;
				}else{
					if(i+2 < h) dpu[i+2][j] += dpr[i][j] % MOD;
					if(j+1 < w) dpr[i][j+1] += dpr[i][j] % MOD;
					if(j+2 < w) dpr[i][j+2] += dpu[i][j] % MOD;
					if(i+1 < h) dpu[i+1][j] += dpu[i][j] % MOD;
					if(i == h-1 && j == w-2){
						dpr[h-1][w-1] += dpu[h-1][w-2] % MOD;
					}else if (i == h-2 && j == w-1){
						dpu[h-1][w-1] += dpr[h-2][w-1] % MOD;
					}
 				}
			}
		}
		cout << (dpu[h-1][w-1] + dpr[h-1][w-1]) % MOD << endl;
	}
}