#include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
void testcase() {
  int m;
  cin >> m;
  VI C(m);
  for (auto& c : C) cin >> c;
  int x, y;
  cin >> x >> y;
  VI Sums(m + 1);
  Sums[0] = 0;
  for (int i = 1; i <= m; i++) Sums[i] = C[i - 1] + Sums[i - 1];
  for (int k = 1; k < m; k++) {
    int begGroup = Sums[k];
    int advGroup = Sums[m] - Sums[k];
    if (x <= begGroup && begGroup <= y && x <= advGroup && advGroup <= y) {
      cout << k + 1 << endl;
      return;
    }
  }
  cout << " 0" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  testcase();
  return 0;
}
