#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  vector<int> v(m);
  int sumv = 0;
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> v[i];
    sumv += v[i];
  }
  cin >> x >> y;
  int ns = 0;
  int j;
  for (j = 0; j < m; j++) {
    if (ns >= x && ns <= y && (sumv - ns) <= y && (sumv - ns) >= x) {
      break;
    } else
      ns += v[j];
  }
  if (j <= m - 1)
    cout << j + 1;
  else
    cout << 0;
  return 0;
}
