#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <cstring>
using namespace std;

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

int main(){
	const int dx[] = {-1,0};
	const int dy[] = {0,-1};
	const int mod = 100000;
	int h,w;
	int dp[2][2][128][128]; //[1=ok,0=no][nouth|west][][]
	
	while(scanf("%d %d",&w,&h),w|h){
		memset(dp,0,sizeof(dp));
		
		dp[1][0][1][2] = dp[1][1][2][1] = 1;
		REP(i,1,h+1){
			REP(j,1,w+1){
				rep(k,2){  // k=0 -> west
					int tx = j + dx[k];
					int ty = i + dy[k];
					dp[1][k][i][j] += (dp[0][k][ty][tx] + dp[1][k][ty][tx])%mod;
					dp[0][k][i][j] += dp[1][(k+1)%2][ty][tx];
					
					//printf("0 %d %d %d  , %d\n",k,i,j,dp[0][k][i][j]);
					//printf("1 %d %d %d  , %d\n",k,i,j,dp[1][k][i][j]);
				}
			}
		}
		int sum = dp[0][0][h][w] + dp[1][0][h][w] +
							dp[0][1][h][w] + dp[1][1][h][w];
		printf("%d\n",sum%mod);
	}
	return 0;
}