#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  int x, y;
  cin >> x >> y;
  int count = 0;
  int k = 0;
  int sum = 0;
  for (int i = 0; i < m; i++) {
    sum += a[i];
  }
  int i;
  for (i = 0; i < m; i++) {
    k += a[i];
    sum -= a[i];
    if (k >= x && k <= y && sum >= x && sum <= y) {
      break;
    }
  }
  if (i < m)
    cout << i + 2;
  else
    cout << "0";
}
