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