#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
//#define int long long
using namespace std;
typedef long long ll;

int n, m;
int pos[100010];
int si, ai;
int ans = 0;

signed main()
{
	cin >> n >> m;
	
	pos[1] = 0;
	rep(i,n-1) {
		cin >> si;
		pos[2+i] = pos[1+i] + si;
	}

	int now = 1;
	rep(i,m) {
		cin >> ai;
		ans += abs(pos[now] - pos[now + ai]) % 100000;
		ans %= 100000;
		now += ai;
	}

	cout << ans << endl;
}