#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int i = 0;
  vector<int> v;
  int total_sum = 0;
  for (int i = (int)0; i < (int)n; ++i) {
    int x;
    scanf("%d", &x);
    total_sum += x;
    v.push_back(x);
  }
  int x, y;
  scanf("%d", &x);
  scanf("%d", &y);
  int sum = 0;
  int flag = 0;
  for (i = n - 1; i >= 0; i--) {
    sum += v[i];
    if ((total_sum - sum) >= x && sum <= y && (total_sum - sum) <= y &&
        sum >= x) {
      cout << i + 1 << endl;
      flag = 1;
      break;
    }
  }
  if (flag == 0) cout << 0 << endl;
  return 0;
}
