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