class Array
    def accum
        inject([0]){|a, x| a + [a[-1] + x]}[1..-1]
    end
end

n, m = gets.split.map &:to_i
s = (1..n-1).map{ gets.to_i }
d = [0] + s.accum
k = 0
total = 0
m.times {
    a = gets.to_i
    total += (d[k + a] - d[k]).abs
    k += a
}
p total % 100000