#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int MAX = 10000000;
double eps = 1e-9;
const long long BIG_INF = 7000000000000000000LL;
const int INF = 2000000000;
double PI = 3.1415926535897932384626433832795;
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
string inttostring(int n) {
  stringstream a;
  a << n;
  string A;
  a >> A;
  return A;
}
int stringtoint(string A) {
  stringstream a;
  a << A;
  int p;
  a >> p;
  return p;
}
int main() {
  int m;
  cin >> m;
  int A[m];
  for (int i = 0; i < m; i++) {
    cin >> A[i];
  }
  int x, y;
  cin >> x >> y;
  for (int i = 1; i < m; i++) {
    A[i] += A[i - 1];
  }
  int g = 0;
  for (int i = 1; i < m; i++) {
    int c = A[m - 1] - A[i - 1];
    if (A[i - 1] >= x && A[i - 1] <= y && c >= x && c <= y) {
      cout << i + 1 << "\n";
      g = 1;
      break;
    }
  }
  if (!g) cout << "0\n";
  return 0;
}
