#include<iostream>
#include<cmath>
using namespace std;
int x[1000000], s[1000000], t[1000000], n, m, sum, u, v;
int main() {
	cin >> n >> m;
	for (int i = 1; i < n; i++) {
		cin >> s[i];
		x[i] = x[i - 1] + s[i];
	}
	u = 1;
	for (int i = 1; i <= m; i++) {
		v = u;
		cin >> t[i];
		u += t[i];
		sum += abs(x[u - 1] - x[v - 1]);
		sum %= 100000;
	}
	cout << sum % 100000 << endl;
	return 0;
}