#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repp(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
// #define int long long
using namespace std;
typedef pair<int, int> P;

const int mod = 100000;

signed main(){
    int w, h;
    while(1){
        cin >> w >> h;
        if(w + h == 0) break;
        int dp[110][110][4] = {0};
        dp[0][1][2] = 1;
        dp[1][0][0] = 1;
        rep(i, 0, h){
            rep(j, 0, w){
                if(i == 0 && j == 0) continue;
                if(i != h - 1){
                    dp[i + 1][j][0] = (dp[i + 1][j][0] + dp[i][j][0] + dp[i][j][1]) % mod;
                    dp[i + 1][j][1] = (dp[i + 1][j][1] + dp[i][j][2]) % mod;
                }
                if(j != w - 1){
                    dp[i][j + 1][2] = (dp[i][j + 1][2] + dp[i][j][2] + dp[i][j][3]) % mod;
                    dp[i][j + 1][3] = (dp[i][j + 1][3] + dp[i][j][0]) % mod;
                }
            }
        }
        int ans = 0;
        rep(k, 0, 4){
            ans += dp[h - 1][w - 1][k];
        }
        cout << ans % mod << endl;
    }
}