#include <vector>
#include <iostream>

using namespace std;

int main()
{
    int n, m, d, r;
    
    scanf("%d", &n);
    scanf("%d", &m);
    
    vector<int> s(n); s[0] = 0;
    vector<int> a(m + 1); a[0] = 0;
    
    for(int i = 1; i < n; i++)
    {
        scanf("%d", &d);
        
        s[i] = d + s[i - 1];
    }
    
    int ret = 0;
    
    for(int i = 1; i <= m; i++)
    {
        scanf("%d", &r);
        
        a[i] = r + a[i - 1];
        
        ret = (ret + abs(s[a[i]] - s[a[i - 1]])) % 100000;
    }
    
    printf("%d\n", ret);
    
    return 0;
}