#include<cstdio>
#include<cstdlib>

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

using namespace std;

int main(){
	int n,m; scanf("%d%d",&n,&m);
	static int dp[100000];
	rep(i,n-1) scanf("%d",dp+i+1), dp[i+1]+=dp[i];

	int total=0,pos=0;
	rep(i,m){
		int a; scanf("%d",&a);
		total+=abs(dp[pos+a]-dp[pos]);
		total%=100000;
		pos+=a;
	}
	printf("%d\n",total);

	return 0;
}