#include <bits/stdc++.h>
using namespace std;
const double PI = 2.0 * acos(0.0);
const double EPS = 1e-9;
const int MOD = 1000000009;
const int INF = 1000000000;
const long long LINF = 1000000000000000000LL;
string str;
int arr[100010];
int main() {
  int n, x, y, ret = 0, s1 = 0, s2 = 0;
  scanf("%d", &n);
  for (int i = int(1); i <= int(n); i++) {
    scanf("%d", &arr[i]);
    s2 += arr[i];
  }
  scanf("%d %d", &x, &y);
  for (int i = int(1); i <= int(n); i++) {
    s1 += arr[i - 1], s2 -= arr[i - 1];
    if (s1 >= x && s1 <= y && s2 >= x && s2 <= y) ret = i;
  }
  printf("%d\n", ret);
  return 0;
}
