#include <bits/stdc++.h>
using namespace std;
struct myp {
  int ver;
  int cost;
};
int dx[4] = {-1, 0, 0, 1};
int dy[4] = {0, 1, -1, 0};
int final[1000008];
bool checkvisited[2007][2007];
bool visited[500];
queue<myp> save;
int check[200];
int neg[100009];
int pos[100009];
int me[2000];
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long myans(long long &a, long long divisor) {
  long long ans = 0;
  while (a % divisor == 0) {
    ans += 1;
    a /= divisor;
  }
  return ans;
}
void godfs(vector<int> *edges, int n, int m, int &cost, int start) {
  for (auto v : edges[start]) {
    if (!check[v]) {
      cost++;
      check[v] = true;
      godfs(edges, n, m, cost, v);
    }
  }
}
struct pii {
  int f;
  int s;
};
void reset() {
  for (int i = 0; i < 27; i++) check[i] = false;
}
int run(int n) {
  if (n == 0) return 2;
  if (n == 1) return 7;
  if (n == 2) return 2;
  if (n == 3) return 3;
  if (n == 4) return 3;
  if (n == 5) return 4;
  if (n == 6) return 2;
  if (n == 7) return 5;
  if (n == 8) return 1;
  return 2;
}
long long solve(int n, vector<long long> *tui) {
  long long pos1 = 0, pos2 = 0, sum = 0;
  for (int i = 1; i < n + 1; i++) {
    sum += min(abs(tui[i][0] - pos1) + abs(tui[i][1] - pos2),
               abs(tui[i][1] - pos1) + abs(tui[i][0] - pos2));
    pos1 = tui[i][0];
    pos2 = tui[i][1];
  }
  return sum;
}
int main() {
  int n;
  cin >> n;
  int *a;
  a = new int[n];
  int total = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    total += a[i];
  }
  int x, y;
  cin >> x >> y;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    if (sum >= x && sum <= y) {
      if (total - sum <= y && total - sum >= x) {
        cout << i + 2;
        return 0;
      }
      for (int j = i + 1; j < n; j++) {
        if (sum + a[j] > y) break;
        sum += a[j];
        if (total - sum <= y && total - sum >= x) {
          cout << j + 2;
          return 0;
        }
      }
      break;
    }
  }
  cout << "0";
}
