#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, x, y, k, b;
  cin >> m;
  vector<int> v(m);
  for (int i = 0; i < m; i++) cin >> v[i];
  for (int i = 1; i < m; i++) v[i] += v[i - 1];
  k = 0, b = 0;
  cin >> x >> y;
  while (k < m) {
    if (v[k] >= x && v[k] <= y && (v[m - 1] - v[k]) >= x &&
        (v[m - 1] - v[k]) <= y)
      b = k + 2;
    k++;
  }
  cout << b;
}
