#include <cstdio>
#include <algorithm>
#pragma warning(disable : 4996)
using namespace std;
int n, m, s[100009], x[100009];
int main() {
	scanf("%d%d", &n, &m);
	for (int i = 1; i < n; i++) scanf("%d", &s[i]), s[i] += s[i - 1];
	long long ret = 0;
	for (int i = 1; i <= m; i++) {
		scanf("%d", &x[i]), x[i] += x[i - 1];
		if (x[i] < x[i - 1]) ret += s[x[i - 1]] - s[x[i]];
		else ret += s[x[i]] - s[x[i - 1]];
	}
	printf("%d\n", ret % 100000);
	return 0;
}