#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define rep(i,x) for(int i=0;i<(x);++i)
#define rep1(i,x) for(int i=1;i<=(x);++i)
#define rrep(i,x) for(int i=(x)-1;i>=0;--i)
#define rrep1(i,x) for(int i=(x);i>=1;--i)
#define int long long
#define FOR(i,a,x) for(int i=(a);i<(x);++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>istream&operator>>(istream&is,vector<T>&vec){rep(i,vec.size())is>>vec[i];return is;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = 1e9;
const ll linf = 3e18;
const double eps = 1e-9;

template<int M>
class mod_int {
    typedef mod_int<M> this_type;

    long long val;

    public:
    mod_int() : val(0) {}
    mod_int(int val) : val(val % M) {}
    mod_int(const this_type& a) : val(a.val) {}

    int value() { return val; }

    operator int() { return val; }

    this_type  operator+ (int a)              { return this_type((val + a % M) % M); }
    this_type  operator- (int a)              { return this_type((val - a % M) % M); }
    this_type  operator* (int a)              { return this_type(val * (a % M) % M); }
    this_type  operator/ (int a)              { return this_type((val / a) % M);     }
    this_type& operator+=(int a)              { return ((val += a % M) %= M, *this); }
    this_type& operator-=(int a)              { return ((val -= a % M) %= M, *this); }
    this_type& operator*=(int a)              { return ((val *= a % M) %= M, *this); }
    this_type& operator/=(int a)              { return ((val /= a) %= M    , *this); }
    this_type  operator+ (const this_type& a) { return this_type((val + a.val % M) % M); }
    this_type  operator- (const this_type& a) { return this_type((val - a.val % M) % M); }
    this_type  operator* (const this_type& a) { return this_type(val * (a.val % M) % M); }
    this_type  operator/ (const this_type& a) { return this_type((val / a.val) % M);     }
    this_type& operator+=(const this_type& a) { return ((val += a.val % M) %= M, *this); }
    this_type& operator-=(const this_type& a) { return ((val -= a.val % M) %= M, *this); }
    this_type& operator*=(const this_type& a) { return ((val *= a.val % M) %= M, *this); }
    this_type& operator/=(const this_type& a) { return ((val /= a.val) %= M    , *this); }

    bool operator<(const this_type& a) const { return val < a.val; }
};

typedef mod_int<100000> ModInt;

ModInt dp[101][101][2][2][2]; // dp[y][x][????????§?????????][??´??????????????£??????][????????£?????????]

signed main()
{
    int W, H;
    
    while (cin >> W >> H, W || H) {
        rep(i, 100) rep(j, 100) rep(k, 2) rep(l, 2) rep(m, 2) dp[i][j][k][l][m] = 0;

        dp[0][1][0][0][0] = 1;
        dp[1][0][1][0][0] = 1;

        rep(i, H) rep(j, W) {
            if (i + j <= 1) continue;
            if (i - 1 >= 0) { // ????????????
                // ?????????????¶?????????????
                dp[i][j][1][0][0] += dp[i - 1][j][1][0][0] + dp[i - 1][j][1][1][1];
                // ??????????????£??????
                dp[i][j][1][1][1] += dp[i - 1][j][0][0][0];
            }
            if (j - 1 >= 0) { // ????????????
                // ?????????????¶?????????????
                dp[i][j][0][0][0] += dp[i][j - 1][0][0][0] + dp[i][j - 1][0][1][0];
                // ??????????????£??????
                dp[i][j][0][1][0] += dp[i][j - 1][1][0][0];
            }
        }

        ModInt ans = 0;

        rep(i, 2) rep(j, 2) rep(k, 2) ans += dp[H - 1][W - 1][i][j][k];

        cout << ans.value() << endl;
    }
}

Measured memory_bytes: 1788