#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  t = 1;
  while (t--) {
    long long n, i, j, w, h, count = 0, sum = 0, total = 0, k, T, breaks = 0, m,
                             x, y;
    string s;
    cin >> m;
    long long c[m];
    for (i = 0; i < m; i++) {
      cin >> c[i];
      sum = sum + c[i];
    }
    cin >> x >> y;
    for (i = 0; i < m; i++) {
      total = total + c[i];
      if (total >= x && total <= y && sum - total >= x && sum - total <= y) {
        breaks = 1;
        break;
      }
    }
    if (breaks == 1) {
      cout << i + 2 << endl;
    } else
      cout << 0;
  }
}
