#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
int n, groupa, groupb, l, r, a[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    groupb += a[i];
  }
  cin >> l >> r;
  for (int i = 1; i <= n; ++i) {
    groupb -= a[i];
    groupa += a[i];
    if (groupb >= l && groupb <= r && groupa >= l && groupa <= r) {
      cout << i + 1 << "\n";
      return 0;
    }
  }
  puts("0");
  return 0;
}
