loop {
	w, h = gets.split.map &:to_i
	break if w == 0
	route = (0..1).map{ (0..h).map{ [0] * (w+1) } }
	route[0][1][0] = 1
	route[1][0][1] = 1
	queues = [[], [[0, 1, 0], [1, 0, 1]]]
	i = 1
	until queues[0].empty? && queues[1].empty?
		queue = queues[i]
		queues[i] = []
		queue.each{|dir, y, x|
			next if y == h-1 && x == w-1
			#p [dir, y, x]
			yx = [y, x]
			yx[dir] += 1
			v, u = yx
			if [[h,w-1], [h-1,w]].include?([v, u]) || (v < h && u < w)
				queues[1-i] << [dir, v, u] if route[dir][v][u] == 0 
				route[dir][v][u] += route[dir][y][x]
				route[dir][v][u] %= 100000
			end
			yx = [y, x]
			yx[1-dir] += 2
			v, u = yx
			if [[h,w-1], [h-1,w]].include?([v, u]) || (v < h && u < w)
				queues[i] << [1-dir, v, u] if route[1-dir][v][u] == 0
				route[1-dir][v][u] += route[dir][y][x]
				route[1-dir][v][u] %= 100000
			end
		}
		i = 1 - i
	end
	p (route[0][h-1][w-1] + route[1][h-1][w-1] + route[0][h][w-1] + route[1][h-1][w]) % 100000
}