#include <bits/stdc++.h>
using namespace std;
int cmp(const void *a, const void *b) { return *(int *)a - *(int *)b; }
typedef struct {
  int v;
  int in;
  int ch;
} Point;
int T, i, j;
int n, m;
int a, b, c;
int w[1000000 + 10];
int x, y, z, ans;
int flag;
int mii, maa;
int miib;
int k, d;
int count1, count2, count3, count4, count6, c24, c63;
Point p[1000000 + 10], P2[1000000 + 10], P3[1000000 + 10], P4[1000000 + 10];
int Py[1000000 + 10], Pz[1000000 + 10], Ps[1000000 + 10], Px[1000000 + 10];
int c1, c2, c3, c4;
int cs, cx, cz, cy;
int sum1, sum2;
int sum;
int temp, now;
int lft;
int cca, ccb;
long long stemp;
int mid;
int s, f;
int l[1000000 + 10], r[1000000 + 10];
int t[1000000 + 10];
char fang;
int num;
int cnt;
int Gcd(int w, int e) {
  if (e == 0) return w;
  return Gcd(e, w % e);
}
int main(void) {
  while (scanf("%d", &m) == 1) {
    memset(t, 0, sizeof(t));
    num = 0;
    flag = 0;
    sum = 0;
    for (i = 1; i <= m; i++) {
      scanf("%d", &t[i]);
    }
    scanf("%d", &x);
    scanf("%d", &y);
    for (i = 1; i <= m; i++) {
      sum += t[i];
    }
    for (i = 1; i <= m; i++) {
      num += t[i];
      if (num >= x && num <= y && sum - num >= x && sum - num <= y) {
        printf("%d\n", i + 1);
        flag = 1;
        break;
      }
    }
    if (flag == 0) printf("0\n");
  }
  return 0;
}
