#include <bits/stdc++.h>
using namespace std;
void prepare(string s = "") {
  if (s != "") {
    freopen((s + ".in").c_str(), "r", stdin);
  }
}
const int NMAX = 110, INF = 1000000000;
int n, v[NMAX], x, y;
void getData() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  cin >> x >> y;
}
void solve() {
  int k = -2;
  for (int i = 1; i < n; ++i) {
    v[i] += v[i - 1];
  }
  for (int i = 0; i < n; ++i) {
    if (v[i] >= x && v[i] <= y && v[n - 1] - v[i] >= x && v[n - 1] - v[i] <= y)
      k = i;
  }
  cout << k + 2;
}
int main() {
  prepare();
  getData();
  solve();
  return 0;
}
