#include <bits/stdc++.h>

using namespace std;

#define rep(i,x) for(int i=0;i<x;++i)
#define all(a) begin(a),end(a)

int d[100010];
int sum[100010];

signed main()
{
    int n, m; cin >> n >> m;

    rep(i, n - 1) cin >> d[i];

    for (int i = 0; i < n - 1; ++i) {
        sum[i + 1] += d[i] + sum[i];
    } 

    int cur = 0;

    int ans = 0;

    rep(i, m) {
        int a;
        cin >> a;

        if (a > 0) {
            ans += sum[cur + a] - sum[cur];
        } else {
            ans += sum[cur] - sum[cur + a];
        }

        cur += a;

        ans %= 100000;
    }

    cout << ans << endl;
}