#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int D[n];
  for (int i = 0; i < n; i++) {
    cin >> D[i];
  }
  int x, y;
  cin >> x >> y;
  int F[n];
  F[n - 1] = D[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    F[i] = D[i] + F[i + 1];
  }
  for (int i = 0; i < n; i = i + 1) {
    if (F[i] <= y && F[i] >= x && F[0] - F[i] <= y && F[0] - F[i] >= x) {
      cout << i + 1;
      return 0;
    }
  }
  cout << 0;
  return 0;
}
