#include <bits/stdc++.h>
const double PI = 3.141592653589793238460;
using namespace std;
void groups() {
  int n;
  cin >> n;
  int isum = 0;
  vector<int> arr(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    isum += arr[i];
  }
  int x, y;
  cin >> x >> y;
  int bsum = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    bsum += arr[i];
    isum -= arr[i];
    if ((bsum >= x && bsum <= y) && (isum >= x && isum <= y)) {
      ans = i + 2;
    }
  }
  cout << (ans > 0 ? ans : 0) << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  groups();
}
