#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

const int MOD = 100000;

int main()
{
    for(;;){
        int w, h;
        cin >> w >> h;
        if(w == 0)
            return 0;

        vector<vector<vector<int> > > num(h+1, vector<vector<int> >(w+1, vector<int>(4, 0)));
        num[0][1][3] = num[1][0][1] = 1;
        for(int i=0; i<h; ++i){
            for(int j=0; j<w; ++j){
                for(int k=0; k<3; ++k){
                    (num[i+1][j][1-k/2] += num[i][j][k+k/2]) %= MOD;
                    (num[i][j+1][2+(k+1)/2] += num[i][j][k+1]) %= MOD;
                }
            }
        }

        int ret = 0;
        for(int i=0; i<4; ++i)
            ret += num[h-1][w-1][i];
        ret %= MOD;
        cout << ret << endl;
    }
}