#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,n) for(int i=1;i<=n;i++)

int main(){
	int n,m;
	cin>>n>>m;
	
	int sum[101000]={0};
	reps(i,n-1){
		cin>>sum[i];
	}
	
	reps(i,n-1){
		sum[i]=sum[i-1]+sum[i];
	}
	
	
	
	int ans=0;
	int now=0;
	
	rep(i,m){
		int a;
		cin>>a;
		
		int val = sum[now]-sum[now+a];
		if(val<0)val*=-1;
		
		ans+=val;
		now+=a;
		
		ans%=100000;
		
		//printf("%d %d %d %d\n",i,now,val,ans); 
	}
	
	printf("%d\n",ans);
}