#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long ll;

int N,M;
int s[100005];
ll cum[100005];

int main(){
  scanf("%d%d",&N,&M);
  for(int i=0;i<N-1;i++) scanf("%d", s+i);
  cum[0] = 0;
  for(int i=1;i<N;i++) cum[i] = s[i-1] + cum[i-1];
  int cur = 0;
  ll res = 0;
  for(int m = 0;m<M;m++){
    int a;
    scanf("%d",&a);
    int tar = cur+a;
    res = (res+abs(cum[cur]-cum[tar]))%100000;
    cur = tar;
  }

  printf("%lld\n", res%100000);
}