#include <bits/stdc++.h>
using namespace std;
bool sortbysecdesc(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second > b.second;
}
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long i, n, x, y, sum = 0, tsum = 0, f = 0, p = 0;
  cin >> n;
  long long c[n];
  for (int i = 0; i < int(n); i++) {
    cin >> c[i];
    tsum += c[i];
  }
  cin >> x >> y;
  for (int i = 0; i < int(n); i++) {
    sum += c[i];
    if (sum >= x && sum <= y && tsum - sum <= y && tsum - sum >= x) {
      f = 1;
      p = i + 2;
      break;
    }
  }
  if (f)
    cout << p << endl;
  else
    cout << 0 << endl;
  return 0;
}
