#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int sm = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sm = sm + a[i];
  }
  int h, l;
  cin >> l >> h;
  int ft = 0, st = sm;
  int i = 0;
  for (i = 0; i < n; i++) {
    ft = ft + a[i];
    st = sm - ft;
    if (ft >= l && st >= l && ft <= h && st <= h) {
      cout << i + 2;
      break;
    }
  }
  if (i == n) cout << 0;
  return 0;
}
