#include <bits/stdc++.h>
int main() {
  int i, m, c[100], x, y, ca = 0, co = 0, k = 0;
  scanf("%d", &m);
  for (i = 0; i < m; i++) {
    scanf("%d", &c[i]);
    ca = ca + c[i];
  }
  scanf("%d %d", &x, &y);
  for (i = 0; i < m; i++) {
    co = co + c[i];
    if (co >= x && co <= y) {
      if ((ca - co) >= x && (ca - co) <= y) {
        k = i + 2;
      }
    }
  }
  printf("%d \n", k);
  return 0;
}
