#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:100000000")
int mas[100100];
int main() {
  int m;
  scanf("%d", &m);
  int sum = 0;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &mas[i]);
    sum += mas[i];
  }
  int x, y;
  scanf("%d %d", &x, &y);
  int cnt = 0;
  for (int k = m; k >= 0; k--) {
    cnt += mas[k];
    sum -= mas[k];
    if (cnt >= x && cnt <= y && sum >= x && sum <= y) {
      printf("%d\n", k);
      return 0;
    }
  }
  printf("0\n");
  return 0;
}
