#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 100000
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_W = 101;
const int MAX_H = 101;

int dp[MAX_W][MAX_H][2];
int w,h;

int main()
{
	while(1){
	scanf("%d%d",&w,&h);
	if(w==0&&h==0){
		break;
	}
	for(int i=1;i<=w;i++){
		dp[i][1][0] = 1;
		dp[i][1][1] = 0;
	}
	for(int j=1;j<=h;j++){
		dp[1][j][0] = 0;
		dp[1][j][1] = 1;
	}
	dp[1][1][0] = 1;
	dp[1][1][1] = 1;
	for(int i=1;i<w;i++){
		for(int j=1;j<h;j++){
			dp[i+1][j+1][0] = (dp[i][j][1] + dp[i][j+1][0])%MOD;
			dp[i+1][j+1][1] = (dp[i][j][0] + dp[i+1][j][1])%MOD;
		}
	}
	printf("%d\n",(dp[w][h][0]+dp[w][h][1])%MOD);
	}
	return 0;
}