#include <iostream>
#include <math.h>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	int x[100010] = {};
	int y[100010] = {};
	int sum = 0;
	for (int i = 0; i < n - 1; i++) {
		int inp;
		cin >> inp;
		sum += inp;
		x[i + 1] = sum;
	}
	int road = 0;
	int index = 0;
	for (int i = 0; i < m; i++) {
		int inp;
		cin >> inp;
		int gap = x[index] - x[index + inp];
		road += (gap > 0) ? gap : -gap;
		road %= 100000;
		index += inp;
	}
	cout << road << endl;
}