#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5;
long long test, n, query, q, k, value, m, x, y;
long long arr[N], pre[N];
int main() {
  scanf("%lld", &n);
  pre[0] = 0;
  for (int i = 1; i < n + 1; i += 1) {
    scanf("%lld", &arr[i]);
    pre[i] = pre[i - 1] + arr[i];
  }
  scanf("%lld", &x), scanf("%lld", &y);
  long long ans = 0, sum1 = 0;
  for (int i = 1; i < n + 1; i += 1) {
    if (pre[i] >= x && (i != n) && pre[i] <= y) {
      if (pre[n] - pre[i] <= y && pre[n] - pre[i] >= x) {
        ans = i + 1;
        break;
      }
    }
  }
  printf("%lld ", ans), cout << endl;
  ;
  return 0;
}
