#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cout.setf(ios::fixed), cout.precision(10);
  int m, x, y;
  cin >> m;
  vector<int> M(m);
  for (int i = 0; i < (m); ++i) cin >> M[i];
  int sum = accumulate(M.begin(), M.end(), 0);
  cerr << sum << endl;
  cin >> x >> y;
  int val = 0;
  for (int i = 0; i < (m); ++i) {
    val += M[i];
    if (val > y) {
      cout << 0 << endl;
      exit(0);
    }
    if (val >= x && sum - val >= x && sum - val <= y) {
      cout << i + 2 << endl;
      exit(0);
    }
  }
  cout << 0 << endl;
}
