#include <iostream>
#include <cmath>
using namespace std;
int dist[100001];
int distC[100001];
int moving[100000];
int pm(int value){
	if(value<0)
	return -1;
	else
	return 1;
}
int main() {
	// your code goes here
	int n,m,now=1,sum=0;
	cin >> n >> m;
	for(int i=2;i<=n;i++){
	cin >> dist[i];
	distC[i]=distC[i-1]+dist[i];
	}
	for(int i=0;i<m;i++){
	cin >> moving[i];
	int a=now;
	now+=moving[i];
	int b=min(now,a);
	a=max(now,a);
	sum=(sum+distC[a]-distC[b])%100000;
	}
	cout << sum << endl;
	return 0;
}