#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, j = 0, cof;
  cin >> n;
  int *mas = new int[n];
  for (int i = 0; i < n; i++) cin >> mas[i];
  int min, max;
  cin >> min >> max;
  bool f = true;
  int sum1 = 0, sum2 = 0;
  while (f) {
    sum1 += mas[j];
    j += 1;
    if (sum1 >= min) {
      f = false;
      cof = j;
      if (sum1 > max) {
        cout << 0;
        return 0;
      }
    }
  }
  for (int i = j + 1; i < n + 1; i++) sum2 += mas[i - 1];
metka1:
  if ((sum2 >= min) && (sum2 <= max))
    cout << cof + 1 << endl;
  else if ((sum2 < min))
    cout << 0 << endl;
  else if (cof == n - 1)
    cout << 0;
  else {
    sum1 += mas[cof];
    if (sum1 > max) {
      cout << 0;
      return 0;
    }
    sum2 -= mas[cof];
    cof++;
    if (sum2 > max) goto metka1;
    cout << cof + 1;
  }
  return 0;
}
