#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  vector<int> C;
  int L, H, temp;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &temp);
    C.push_back(temp);
    if (i != 0) {
      C[i] += C[i - 1];
    }
  }
  scanf("%d %d", &L, &H);
  int i, low, high;
  for (i = 0; i < N && C[i] < L; i++)
    ;
  low = i;
  for (i = low; i < N && C[i] <= H; i++)
    ;
  high = i - 1;
  for (i = low; i <= high; i++) {
    temp = C[N - 1] - C[i];
    if (temp <= H && temp >= L) {
      printf("%d\n", i + 2);
      return 0;
    }
  }
  printf("0\n");
  return 0;
}
