#include <iostream>
#include <vector>

template <class T>
std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); }

constexpr int MOD = 100000;
constexpr int X = 100;

std::vector<std::vector<int>> dp;

int dfs(int i, int j) {
    auto& ret = dp[i][j];
    if (ret != -1) return ret;

    if (i == 0 && j == 0) {
        return ret = 1;
    }

    ret = 0;
    if (i == 1 && j == 0) (++ret) %= MOD;
    for (int d = 2; d <= i; ++d) {
        (ret += dfs(j, i - d)) %= MOD;
    }
    return ret;
}

bool solve() {
    int w, h;
    std::cin >> w >> h;
    if (w == 0) return false;
    --w, --h;

    int ans = 0;
    for (int d = 1; d <= w; ++d) {
        (ans += dfs(h, w - d)) %= MOD;
    }
    for (int d = 1; d <= h; ++d) {
        (ans += dfs(w, h - d)) %= MOD;
    }

    std::cout << ans << "\n";
    return true;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    dp = vec(X, vec(X, -1));
    for (int i = 0; i < X; ++i) {
        for (int j = 0; j < X; ++j) {
            dfs(i, j);
        }
    }

    while (solve()) {}

    return 0;
}

