#include<stdio.h>
int main(void){
    int n,m,t[100001],s[100001],i,j,ans=0,from,to;
    from=0;
    scanf("%d%d",&n,&m);
    n--;
    for(i=0; i<n; i++){
        scanf("%d",&s[i]);
        t[i]=0;
    }
    for(i=0; i<m; i++){
        scanf("%d",&to);
        to+=from;
        if(to>from){
            for(j=from; j<to; j++){
                t[j]++;
            }
        }else{
            for(j=to; j<from; j++){
                t[j]++;
            }
        }
        from = to;
    }
    for(i=0; i<n; i++){
        ans+=s[i]*t[i];
        ans%=100000;
    }
    printf("%d\n",ans);
    return 0;
}