#include <bits/stdc++.h>
using namespace std;
void input() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long v[n];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    sum += v[i];
  }
  long long x, y;
  cin >> x >> y;
  long long t = 0;
  for (int i = 0; i < n; i++) {
    t += v[i];
    sum -= v[i];
    if (sum >= x && sum <= y && t >= x && t <= y) {
      cout << i + 2 << "\n";
      return 0;
    }
  }
  cout << 0 << "\n";
  return 0;
}
