#include<bits/stdc++.h>
using namespace std;
int memo[101][101][3][3];
int dfs(int x,int y,int bef1,int bef2){
  int ret = 0;
  if(x == 1 && y == 1) return 1;
  if(memo[x][y][bef1][bef2] != -1) return memo[x][y][bef1][bef2];
  if(x-1 >= 1){
    if(bef1 == bef2 || bef1 != 1) ret = (ret + dfs(x-1,y,bef2,1))%100000;
  }
  if(y-1 >= 1){
    if(bef1 == bef2 || bef1 != 2) ret = (ret + dfs(x,y-1,bef2,2))%100000;
  }
  return memo[x][y][bef1][bef2] = ret;
}
int main(){
  int w,h;
  while(scanf("%d %d",&w,&h),w!=0&&h!=0){
    for(int i=1;i<101;i++){
      for(int j=1;j<101;j++){
	for(int k=0;k<3;k++){
	  for(int l=0;l<3;l++) memo[i][j][k][l] = -1;
	}
      }
    }
    printf("%d\n",dfs(w,h,0,0));
  }
  return (0);
}