#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    for (int i = 1; i < n; i++) {
      a[i] += a[i - 1];
    }
    int x, y;
    scanf("%d%d", &x, &y);
    for (int i = 0; i < n; i++) {
      int a1 = i == 0 ? 0 : a[i - 1];
      int a2 = a.back() - a1;
      if (a1 >= x && a1 <= y && a2 >= x && a2 <= y) {
        printf("%d\n", i + 1);
        return 0;
      }
    }
    printf("0");
  }
}
