#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;


signed main(){
	int n, m;
	cin >> n >> m;
	vi d(n);
	d[0] = 0;
	rep(i, 1, n){
		cin >> d[i];
	}
	rep(i, 1, n){
		d[i] += d[i - 1];
	}
	int now = 0, ans = 0, mod = 100000;
	rep(i, 0, m){
		int a;
		cin >> a;
		ans += abs(d[now] - d[now + a]);
		now += a;
		ans %= mod;
	}
	cout << ans << endl;
}