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

using namespace std;

#define REP(i,s,e) for(int i=int(s);i<=int(e);i++)
#define rep(i,n) for(int i=0;i<int(n);i++)

#define mod 100000

int T[101][101][4];

int main(){

	while(1){
		int h,w;
		cin >> w >> h;
		if(w==0 && h==0) break;

		rep(i,h) T[i][0][0]=1;
		rep(i,w) T[0][i][2]=1;

		REP(i,1,h-1){
			REP(j,1,w-1){

				T[i][j][0]=(T[i-1][j][0]+T[i-1][j][1])%mod;
				T[i][j][1]=T[i-1][j][2]%mod;
				T[i][j][2]=(T[i][j-1][2]+T[i][j-1][3])%mod;
				T[i][j][3]=T[i][j-1][0]%mod;
			}
		}

		cout << (T[h-1][w-1][0]+T[h-1][w-1][1]+T[h-1][w-1][2]+T[h-1][w-1][3])%mod << endl;

	}

	return 0;
}