#include <bits/stdc++.h>
using ll = long long;
int main() {
  int n, x, y;
  std::cin >> n;
  std::vector<int> v(n + 1);
  for (int i{1}; i <= n; ++i) {
    std::cin >> v[i];
    v[i] += v[i - 1];
  }
  std::cin >> x >> y;
  for (int i{1}; i <= n; ++i) {
    bool bc_ok{x <= v[i] && v[i] <= y};
    bool ic_ok{x <= v.back() - v[i] && v.back() - v[i] <= y};
    if (bc_ok && ic_ok) {
      std::cout << i + 1 << std::endl;
      return 0;
    }
  }
  std::cout << 0 << std::endl;
}
