#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <queue>

#define INF (1e+9)
#define LLINF (1e+18)
#define LL long long

#define C (100000)

using namespace std;


int w,h;

//dp[x][y][k]
int dp[128][128][4] = {0};
int ans;

int ResetDp(){
	for(int i = 0;i < 128;i++){
		for(int j = 0;j < 128;j++){
			for(int k = 0;k < 4;k++){
				dp[i][j][k] = 0;
			}
		}
	}

	return 0;
}

int main (void){
	while(true){
		scanf("%d%d",&w,&h);
		if((w == 0)&&(h == 0))break;
		ResetDp();
		ans = 0;
		dp[1][1][0] = 1;
		dp[1][1][2] = 1;
		for(int i = 1;i <= w;i++){
			for(int j = 1;j <= h;j++){
				for(int k = 0;k < 4;k++){
					dp[i][j][k] %= C;
				}


				dp[i + 1][j][1] += dp[i][j][0];
				dp[i + 1][j][1] += dp[i][j][1];
				dp[i + 1][j][0] += dp[i][j][3];

				dp[i][j + 1][3] += dp[i][j][2];
				dp[i][j + 1][3] += dp[i][j][3];
				dp[i][j + 1][2] += dp[i][j][1];
			}
		}

		for(int i = 0;i < 4;i++){
			ans += dp[w][h][i];
			ans %= C;
		}
		printf("%d\n",ans);
	}

	return 0;
}