#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    int aa[n], w = 0;
    for (int i = 0; i <= n - 1; i++) cin >> aa[i], w += aa[i];
    int x, y, sum = 0, q = 1;
    cin >> x >> y;
    for (int i = 0; i <= n - 1; i++) {
      sum += aa[i];
      if (sum >= x && sum <= y && w - sum >= x && w - sum <= y) {
        cout << i + 2 << "\n";
        q = 0;
        break;
      }
    }
    if (q) cout << 0 << "\n";
  }
  return 0;
}
