#include<cstdio>
#define rep(i,a) for(i=0;i<a;i++)
int MOD=100000,i,j,k,n,m;
int main(){
    while(scanf("%d%d",&n,&m),n){
        int dp[110][110][2]={0};
        dp[1][0][0]=dp[0][1][1]=1;
        rep(i,n)rep(j,m)rep(k,2){
			(dp[i+1+k][j][0]+=dp[i][j][k])%=MOD;
			(dp[i][j+1+(1^k)][1]+=dp[i][j][k])%=MOD;
        }
		printf("%d\n",(dp[n][m-1][0]+dp[n-1][m][1])%MOD);
    }
}