#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int m;
  cin >> m;
  int C[m];
  for (int i = 0; i < m; ++i) cin >> C[i];
  int x, y;
  cin >> x >> y;
  int sum_1, sum_2;
  sum_1 = sum_2 = 0;
  int now = 0;
  for (int i = 0; i < m; ++i) sum_2 += C[i];
  while (sum_1 < x || sum_1 > y || sum_2 < x || sum_2 > y) {
    if (now == m) break;
    sum_1 += C[now];
    sum_2 -= C[now];
    ++now;
  }
  if (now == m)
    cout << 0;
  else
    cout << now + 1;
  return 0;
}
