#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1<<30;

//aoj 0549
typedef int SegT;
const int defvalue=0;
class SegTree{
	private:
		vector<SegT>val;
		int n;
		SegT combine(SegT a,SegT b){return a+b;}
	public:
		SegTree(int size){
			n=1;
			while(n<size)n<<=1;
			val=vector<SegT>(2*n,defvalue);
		}
		SegTree(const vector<SegT> &in){
			n=1;
			while(n<in.size())n<<=1;
			val=vector<SegT>(2*n,defvalue);
			for(int i=n-1+in.size()-1;i>=0;i--){
				if(n-1<=i)val[i]=in[i-(n-1)];
				else val[i]=combine(val[i*2+1],val[i*2+2]);
			}
		}
		void update(int i,SegT a){
			i+=n-1;
			val[i]=a;
			while(i>0){
				i=(i-1)/2;
				val[i]=combine(val[i*2+1],val[i*2+2]);
			}
		}
		SegT query(int a,int b,int k=0,int l=0,int r=-1){//[a,b)
			if(a>b)swap(a,b);
			if(r==-1)r=n;
			if(r<=a||b<=l)return defvalue;
			if(a<=l&&r<=b)return val[k];
			else return combine(query(a,b,k*2+1,l,(l+r)/2),query(a,b,k*2+2,(l+r)/2,r));
		}
		void tmp(){
			rep(i,val.size())cout<<" "<<val[i];cout<<endl;
		}
};
int main(){
	int n,m;
	cin>>n>>m;
	SegTree st(n-1);
	rep(i,n-1){
		int a;
		cin>>a;
		st.update(i,a);
	}
	int out=0;
	//18
	vi in(m+1);
	rep(i,m)cin>>in[i+1];
	rep(i,m)in[i+1]+=in[i];
	rep(i,m)out=(out+st.query(in[i],in[i+1]))%100000;
	cout<<out<<endl;
}
//aoj 0547
/*int MOD=100000;
int main(){
	int n,m;
	while(cin>>n>>m,n+m){
		int dp[110][110][2]={0};
		dp[1][0][0]=dp[0][1][1]=1;
		rep(i,n)rep(j,m)if(i!=n-1||j!=m-1){
			if(dp[i][j][0]){
				dp[i+1][j][0]=(dp[i+1][j][0]+dp[i][j][0])%MOD;
				dp[i][j+2][1]=(dp[i][j+2][1]+dp[i][j][0])%MOD;
			}
			if(dp[i][j][1]){
				dp[i+2][j][0]=(dp[i+2][j][0]+dp[i][j][1])%MOD;
				dp[i][j+1][1]=(dp[i][j+1][1]+dp[i][j][1])%MOD;
			}
		}
		cout<<(dp[n-1][m-1][0]+dp[n-1][m-1][1]
			+dp[n][m-1][0]+dp[n-1][m][1])%MOD<<endl;
	}
}*/
//aoj 0596
/*vi visit,d;
vvi G;
void dfs(int a,int b){
	d[a]=b;
	rep(i,G[a].size()){
		int to=G[a][i];
		if(visit[to]==false&&d[to]>b+1){
			visit[a]=true;
			d[to]=b+1;
			dfs(to,b+1);
			visit[a]=false;
		}
	}
}
struct edge{
	int to,cost;
};
int main(){
	int n,m;
	cin>>n>>m;
	vp in(n);
	rep(i,n)cin>>in[i].first>>in[i].second;
	G=vvi(n);
	rep(i,m){
		int a,b;
		cin>>a>>b;
		a--;b--;
		G[a].pb(b);
		G[b].pb(a);
	}
	vector<vector<edge> > g(n);
	rep(i,n){
		visit=vi(n);
		d=vi(n,inf);
		visit[i]=true;
		dfs(i,0);
		rep(j,n)if(d[j]<=in[i].second)g[i].pb(edge{j,in[i].first});
	}
	d=vi(n,inf);
	d[0]=0;
	priority_queue<pii>q;
	q.push(pii(0,0));
	while(!q.empty()){
		pii p=q.top();
		q.pop();
		int pos=p.second,cost=-p.first;
		if(cost>d[pos])continue;
		rep(i,g[pos].size()){
			edge e=g[pos][i];
			int to=e.to;
			int nowcost=cost+e.cost;
			if(nowcost<d[to]){
				d[to]=nowcost;
				q.push(pii(-d[to],to));
			}
		}
	}
	cout<<d[n-1]<<endl;
}
*/



	

Measured memory_bytes: 3120