#include <bits/stdc++.h>
using namespace std;
int n, m;
int d[10005];
long long g, r;
int dist[10005][1005];
int b[10005][1005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) cin >> d[i];
  d[m + 1] = n;
  sort(d + 1, d + m + 2);
  cin >> g >> r;
  deque<pair<int, int> > q;
  q.push_back({0, 0});
  b[0][0] = 1;
  long long res = -1;
  while (!q.empty()) {
    int v = q.front().first;
    int t = q.front().second;
    q.pop_front();
    if (t == 0) {
      int tt = n - d[v];
      if (tt <= g) {
        long long temp = (r + g) * dist[v][t] + tt;
        if (res == -1 || res > temp) res = temp;
      }
    }
    if (t == g) {
      if (b[v][0] == 0) {
        dist[v][0] = dist[v][t] + 1;
        q.push_back({v, 0});
        b[v][0] = 1;
      }
      continue;
    }
    if (v != 0) {
      int tt = t + d[v] - d[v - 1];
      if (tt <= g && b[v - 1][tt] == 0) {
        b[v - 1][tt] = 1;
        dist[v - 1][tt] = dist[v][t];
        q.push_front({v - 1, tt});
      }
    }
    if (v < m - 1) {
      int tt = t + d[v + 1] - d[v];
      if (tt <= g && b[v + 1][tt] == 0) {
        b[v + 1][tt] = 1;
        dist[v + 1][tt] = dist[v][t];
        q.push_front({v + 1, tt});
      }
    }
  }
  cout << res;
  return 0;
}
