#include <bits/stdc++.h>
using namespace std;
bool in_range(int x, int y, int target) { return x <= target && y >= target; }
int main() {
  int m;
  cin >> m;
  int nums[m];
  int breaks[m + 1];
  int sum = 0;
  breaks[0] = sum;
  for (int i = 0; i < m; i++) {
    cin >> nums[i];
    sum += nums[i];
    breaks[i + 1] = sum;
  }
  int x, y;
  cin >> x >> y;
  for (int i = 0; i < m + 1; i++) {
    if (in_range(x, y, breaks[i]) && in_range(x, y, sum - breaks[i]) && i < m) {
      cout << i + 1;
      return 0;
    }
  }
  cout << 0;
}
