#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, y, sum = 0, a = 0, b = 0;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  cin >> x >> y;
  for (long long i = 0; i < n; i++) {
    a += arr[i];
    sum -= arr[i];
    if (a >= x and a <= y) {
      if (sum >= x and sum <= y) {
        b = i + 2;
        break;
      }
    }
  }
  cout << b << endl;
}
