fun main(args:Array<String>?): Unit {
    while(true){
        val (w, h) = readLine()!!.trim().split(' ').map(String::toInt)
        if (w == 0 && h == 0) return
        println(solve(w, h))
    }
}
fun solve(w: Int, h: Int): Int {
    val mod = 100000
    class State(val northToSouth: Int, val westToEast: Int, val northToEast: Int, val westToSouth: Int) {
        fun sum(): Int = northToSouth + northToEast + westToEast + westToSouth
    }
    val memo = Array(h){Array(w){State(-1, -1,-1,-1)}}
    memo[0][0] = State(1, 1, 0, 0)
    fun sub(x: Int, y: Int): State {
        return if (x < 0 || y < 0) State(0, 0, 0, 0)
        else {
            if (memo[y][x].sum() < 0){
                val north = sub(x, y - 1)
                val east = sub(x - 1, y)
                memo[y][x] = State((north.northToSouth + north.westToSouth) % mod, (east.westToEast + east.northToEast) % mod, north.northToSouth, east.westToEast)
            }
            memo[y][x]
        }
    }
    return (sub(w - 2, h - 1).northToEast + sub(w - 2, h - 1).westToEast + sub(w - 1, h - 2).northToSouth + sub(w - 1, h - 2).westToSouth) % mod
}
