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