#include <bits/stdc++.h>
using namespace std;
int n, m, j, k, sum, a[100000050], tree[100000050];
int lowbit(int x) { return x & -x; }
void xg(int x) {
  for (; x <= n; x += lowbit(x)) tree[x] = a[x];
}
int qh(int x) {
  int ans = 0;
  for (; x > 0; x -= lowbit(x)) ans += tree[x];
  return ans;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    xg(i);
  }
  scanf("%d%d", &j, &k);
  printf("%d", qh(k) - qh(j));
}
