#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<set>
#include<map>
#include<random>
#include<functional>
#include<utility>

typedef long long ll;

#define rep(i,n) for(int i=0; i<n; i++)
#define pb push_back
#define P pair<int, int>
#define PLI pair<ll, int>
#define PLL pair<ll, ll>
#define VI vector<int>
#define VII vector<VI>

using namespace std;


const int MOD = 100000;

int W, H;
int dp[105][105][3][3];

int dx[] = { 1, 0 }, dy[] = { 0,1 };

int solve(int x, int y, int to, int ren) { //to 0:east 1:north
	if (x == W - 1 && y == H - 1) return 1;
	if (dp[x][y][to][ren] != -1) return dp[x][y][to][ren];

	int ret = 0;
	ret += solve(x + dx[to], y + dy[to], to, 0);
	if (ren != 1) {
		ret += solve(x + dy[to], y + dx[to], (to+1)%2, 1);
	}

	return dp[x][y][to][ren] = ret%MOD;
}

int main() {
	while (cin >> W >> H, W)
	{
		rep(i, W)rep(j, H)rep(k, 2)rep(l, 3) {
			dp[i][j][k][l] = -1;
		}
		cout << (solve(0, 0, 0, 1) + solve(0, 0, 1, 1))%MOD << endl;
	}

	return 0;
}

