#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007LL;
inline void fastio() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  std::cout.tie(0);
}
inline void debug() {}
const long long int maxn = (3 * 1e5);
int main(void) {
  fastio();
  debug();
  int n, l, r;
  cin >> n;
  vector<int> a(n);
  for (auto& x : a) cin >> x;
  cin >> l >> r;
  vector<int> pref(n, 0);
  vector<int> suf(n, 0);
  for (int i = 1; i < n; i++) {
    pref[i] = pref[i - 1] + a[i - 1];
  }
  for (int i = n - 2; i >= 0; i--) {
    suf[i] = suf[i + 1] + a[i + 1];
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int left = pref[i];
    int right = suf[i];
    int ss = a[i];
    if (left + ss >= l && right >= l && left + ss <= r && right <= r) {
      ans = i + 1;
      break;
    } else if (left >= l && right + ss >= l && left <= r && right + ss <= r) {
      ans = i + 1;
      break;
    }
  }
  ans ? cout << ans + 1 << "\n" : cout << 0 << "\n";
}
