#include <bits/stdc++.h>
using namespace std;
const int M = 20020;
const int G = 2020;
const int N = M * G;
const int INF = 2e9 + 9;
int id(int v, int r) { return G * v + r; }
int n;
int m;
int g;
int s;
int coord[M];
int dist[N];
deque<int> q;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> coord[i];
  }
  sort(coord, coord + m);
  cin >> g >> s;
  fill_n(dist, N, INF);
  dist[0] = 0;
  q.emplace_back(0);
  while (q.size()) {
    int v = q.front();
    q.pop_front();
    int i = v / G;
    int r = v % G;
    if (r == g) {
      int u = id(i, 0);
      if (dist[u] > dist[v] + s) {
        dist[u] = dist[v] + s;
        q.emplace_back(u);
      }
      continue;
    }
    if (i > 0) {
      int w = coord[i] - coord[i - 1];
      if (r + w <= g) {
        int u = id(i - 1, r + w);
        if (dist[u] > dist[v] + w) {
          dist[u] = dist[v] + w;
          q.emplace_front(u);
        }
      }
    }
    if (i + 1 < m) {
      int w = coord[i + 1] - coord[i];
      if (r + w <= g) {
        int u = id(i + 1, r + w);
        if (dist[u] > dist[v] + w) {
          dist[u] = dist[v] + w;
          q.emplace_front(u);
        }
      }
    }
  }
  int answer = INF;
  for (int r = 0; r <= g; ++r) {
    answer = min(answer, dist[id(m - 1, r)]);
  }
  if (answer < INF) {
    cout << answer << "\n";
  } else {
    cout << "-1\n";
  }
  return 0;
}
