#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-9;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
double PI = acos(-1);
int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};
int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};
long long power(long long x, long long y) {
  if (y == 0) return 1;
  return x * power(x, y - 1);
}
long long d[10004];
long long r, n, m, g;
vector<vector<bool>> visited;
vector<vector<int>> dist;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int(i) = (0); (i) < (m); ++(i)) cin >> d[i];
  sort(d, d + m);
  if (d[m - 1] != n) {
    d[m] = n;
    m++;
  }
  cin >> g >> r;
  visited.resize(m + 1, vector<bool>(g + 1));
  dist.resize(m + 1, vector<int>(g + 1));
  deque<pair<int, int>> q;
  long long ans = -1;
  q.push_back({0, 0});
  visited[0][0] = 1;
  dist[0][0] = 0;
  while (!q.empty()) {
    int x = q.front().first;
    int y = q.front().second;
    q.pop_front();
    if (y == g) {
      if (visited[x][0] == 0) {
        dist[x][0] = dist[x][y] + 1;
        visited[x][0] = 1;
        q.push_back({x, 0});
      }
      continue;
    }
    if (y == 0) {
      if (n - d[x] <= g) {
        if (ans == -1 || ans > ((r + g) * dist[x][y] + n - d[x])) {
          ans = (r + g) * dist[x][y] + n - d[x];
        }
      }
    }
    if (x) {
      if (d[x] - d[x - 1] + y <= g and
          visited[x - 1][d[x] - d[x - 1] + y] == 0) {
        dist[x - 1][d[x] - d[x - 1] + y] = dist[x][y];
        visited[x - 1][d[x] - d[x - 1] + y] = 1;
        q.push_front({x - 1, d[x] - d[x - 1] + y});
      }
    }
    if (x < m - 1) {
      if (d[x + 1] - d[x] + y <= g and
          visited[x + 1][d[x + 1] - d[x] + y] == 0) {
        dist[x + 1][d[x + 1] - d[x] + y] = dist[x][y];
        visited[x + 1][d[x + 1] - d[x] + y] = 1;
        q.push_front({x + 1, d[x + 1] - d[x] + y});
      }
    }
  }
  cout << ans;
  return 0;
}
