#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<long long int> data(n);
	data[0] = 0;
	for (int i = 1; i < n; i++) {
		cin >> data[i];
		data[i] += data[i-1];
	}
	int counter = 0;
	long long int kyo = 0;
	int a;
	for (int i = 0; i < m; i++) {
		cin >> a;
		kyo += abs(data[a+counter]-data[counter]);
		counter += a;
	}
	cout << kyo%100000 << endl;
	return 0;
}