#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  int tab[m + 1];
  int stotale = 0;
  for (int i = 1; i <= m; ++i) {
    cin >> tab[i];
    stotale += tab[i];
  }
  int x, y;
  cin >> x >> y;
  int s = 0;
  int p = 0;
  for (int i = 1; i < m; ++i) {
    s += tab[i];
    if ((s >= x && s <= y) && (stotale - s >= x && stotale - s <= y)) {
      p = i + 1;
      break;
    }
  }
  cout << p << endl;
  return 0;
}
