var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
while(true){
   var wh=arr.shift().split(" ").map(Number);
   if(wh.join(" ")=="0 0")break;
   var w=wh[0];
   var h=wh[1];
   var dp=[];
   for(var i=0;i<w;i++){
      dp[i]=[];
      for(var j=0;j<h;j++){
         dp[i][j]=[];
         for(var k=0;k<=4;k++){
            dp[i][j][k]=0;
         }
      }
   }
   dp[0][0][1]=1;
   dp[0][0][2]=1;
   for(var i=0;i<w;i++){
      for(var j=0;j<h;j++){
         if(i!=w-1)dp[i+1][j][3]+=dp[i][j][1]%100000;
         if(j!=h-1)dp[i][j+1][4]+=dp[i][j][2]%100000;
         if(i!=w-1)dp[i+1][j][3]+=dp[i][j][3]%100000;
         if(j!=h-1)dp[i][j+1][2]+=dp[i][j][3]%100000;
         if(i!=w-1)dp[i+1][j][1]+=dp[i][j][4]%100000;
         if(j!=h-1)dp[i][j+1][4]+=dp[i][j][4]%100000;
      }
   }
   var sum=dp[w-1][h-1].reduce(function(a,b){return a+b;});
   console.log(sum%100000);
}