#include <bits/stdc++.h>

using namespace std;

int main(void) {
  const int mod = 100000;
  int w, h;
  while (cin >> w >> h, w) {
    int dp[210][110][2] = {};
    for (int i = 0; i < 2 * h - 1; i++) {
      if (i & 1) {
        for (int j = 0; j < w; j++) {
          if (j == 0) {
            dp[i][j][0] = 0;
            dp[i][j][1] = 1;
          } else {
            dp[i][j][0] = dp[i - 1][j - 1][1];
            if (i == 1) continue;
            dp[i][j][1] = (dp[i - 2][j][0] + dp[i - 2][j][1]) % mod;
          }
        }
      } else {
        for (int j = 0; j < w - 1; j++) {
          if (i == 0) {
            dp[i][j][0] = 0;
            dp[i][j][1] = 1;
          } else {
            dp[i][j][0] = dp[i - 1][j][1];
            if (j == 0) continue;
            dp[i][j][1] = (dp[i][j - 1][0] + dp[i][j - 1][1]) % mod;
          }
        }
      }
    }

    int ans = 0;
    ans += dp[2 * h - 2][w - 2][0];
    ans += dp[2 * h - 2][w - 2][1];
    ans += dp[2 * h - 3][w - 1][0];
    ans += dp[2 * h - 3][w - 1][1];
    ans %= mod;

    cout << ans << endl;
  }

  return 0;
}
