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