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