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