### constant

MOD = 100000;

### main

n, m = gets.strip.split(' ').map{|s| s.to_i}

sbs = [0]
sum = 0
(n - 1).times do
  sum += gets.strip.to_i
  sbs << sum
end

total = 0
pos = 0

m.times do
  d = gets.strip.to_i
  pos0 = pos + d
  total = (total + (sbs[pos0] - sbs[pos]).abs) % MOD
  pos = pos0
end

puts total