## constant

MOD = 100000;

### main

loop do
  w, h = gets.strip.split(' ').map{|s| s.to_i}
  break if (w | h) == 0
  #p [w, h]

  ## 0 = h&v:ok, 1=h&v:ng, 2 = v&h:ok, 3 = v&h:ng
  rts = h.times.map{w.times.map{[0] * 4}}

  (0...h).each{|y| rts[y][0][2] = 1}
  (0...w).each{|x| rts[0][x][0] = 1}

  for y in (1...h)
    for x in (1...w)
      rts[y][x][0] = (rts[y][x - 1][0] + rts[y][x - 1][1]) % MOD
      rts[y][x][1] = rts[y][x - 1][2]
      rts[y][x][2] = (rts[y - 1][x][2] + rts[y - 1][x][3]) % MOD
      rts[y][x][3] = rts[y - 1][x][0]
    end
  end
  #p rts

  sum = 0
  for rt in rts[h - 1][w - 1]
    sum = (sum + rt) % MOD
  end

  puts sum
end