#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, sum = 0;
  cin >> m;
  int arr[m];
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  int x, y;
  cin >> x >> y;
  int g1, g2;
  g2 = arr[m - 1], g1 = sum - g2;
  for (int i = m - 2; i >= 0; i--) {
    if (g1 < x || g1 > y || g2 < x || g2 > y) {
      g1 -= arr[i];
      g2 += arr[i];
    } else {
      cout << i + 2 << endl;
      return 0;
    }
  }
  cout << "0" << endl;
  return 0;
}
