#include <bits/stdc++.h>
using namespace std;

const int mod = 1e5;

int main()
{
	int n, m;
	cin >> n >> m;
	vector<int> a(n);
	for (int i = 1; i < n; i++) {
		cin >> a[i]; a[i] += a[i - 1];
	}
	int p = 0, res = 0;
	while (m--) {
		int x;
		cin >> x;
		res = (res + abs(a[p + x] - a[p])) % mod;
		p += x;
	}
	cout << res << endl;
	return 0;
}

