#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  cin >> n;
  int total = 0, l = 0, r;
  vector<int> arr{};
  arr.push_back(0);
  for (int i = 0; i < n; i++) {
    cin >> p;
    arr.push_back(p);
    total = total + p;
  }
  int x, y;
  cin >> x >> y;
  int i;
  for (i = 1; i <= n; i++) {
    l = l + arr[i];
    r = total - l;
    if ((l >= x) && (r <= y) && (l <= y) && (r >= x)) break;
  }
  if (i == n + 1)
    cout << 0;
  else
    cout << i + 1;
}
