#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

const int mod = 100000;

int main()
{
int n, m;
vector<int> s;

scanf("%d%d", &n, &m);
s.resize(n, 0);
for(int i = 1; i < n; ++i) {
int temp;
scanf("%d", &temp);
s[i] = s[i - 1] + temp;
}

int total = 0;
int pos = 0;

for(int i = 0; i < m; ++i) {
int diff, next;
scanf("%d", &diff);
next = pos + diff;
total += abs(s[pos] - s[next]);
total %= mod;
pos = next;
}

printf("%d\n", total);

return 0;
}