#include <bits/stdc++.h>

using namespace std;

#define int long long
#define LL long long
#define ULL unsigned long long

const int LL_INF = ~(ULL)0 >> 1;

signed main() {
    int n, m, joi[100002] = {0};
    cin >> n >> m;

    for (int i = 0; i < n - 1; ++i) {
        int temp;
        cin >> temp;
        joi[i + 1] = joi[i] + temp;
    }

    int sum = 0, pos = 0;
    for (int i = 0; i < m; ++i) {
        int mv;
        cin >> mv;
        sum += abs(joi[pos] - joi[pos + mv]);
        sum %= 100000;
        pos += mv;
    }

    cout << sum << endl;

    return 0;
}