#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    vector<int> v(n);
    int sum = 0, sum1 = 0;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      sum1 += v[i];
    }
    int x, y;
    cin >> x >> y;
    int ans = 0;
    for (int i = 0; i < n; i++) {
      if (sum >= x && sum <= y && sum1 >= x && sum1 <= y) {
        ans = i + 1;
        break;
      } else {
        sum += v[i];
        sum1 -= v[i];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
