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