#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, *C;
  cin >> m;
  C = new int[m];
  int i, x, y;
  int S = 0;
  for (i = 0; i < m; ++i) {
    cin >> C[i];
    S += C[i];
  }
  cin >> x >> y;
  int t = 0;
  for (i = 0; i < m; ++i) {
    t += C[i];
    if (x <= t && t <= y && x <= S - t && S - t <= y) break;
  }
  if (0 <= i && i < m)
    cout << i + 2;
  else
    cout << 0;
  return 0;
}
