#include <bits/stdc++.h>
#define INF 2147483647
#define INF_LL 9223372036854775807
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

int main() {
	while (1) {
		int H, W;
		cin >> H >> W;
		if (H == 0 && W == 0)break;
		vector<vector<vector<int>>> dp(4, vector<vector<int> >(H + 1, vector<int>(W + 1, 0)));// 0右直進 1上直進 2右(曲がった)　3上(曲がった)
		dp[1][1][0] = 1; dp[0][0][1] = 1;
		for (int i = 0; i < H; i++)for (int j = 0; j < W; j++)for (int k = 0; k < 4; k++) {
			dp[k][i][j] %= 100000;
			if (k == 0) {
				dp[3][i + 1][j] += dp[k][i][j];
				dp[0][i][j + 1] += dp[k][i][j];
			}
			else if (k == 1) {
				dp[2][i][j + 1] += dp[k][i][j];
				dp[1][i + 1][j] += dp[k][i][j];
			}
			else if (k == 2) {
				dp[0][i][j + 1] += dp[k][i][j];
			}
			else if (k == 3) {
				dp[1][i + 1][j] += dp[k][i][j];
			}
		}

		cout << (dp[0][H - 1][W - 1] + dp[1][H - 1][W - 1] + dp[2][H - 1][W - 1] + dp[3][H - 1][W - 1]) % 100000 << endl;
	}
	return 0;
}
