#include <bits/stdc++.h>
int n, m, S[1000005], dist[10005][1005], green, red, Ans = 2100000000;
std::deque<std::pair<int, int> > Q;
bool inq[10005][1005];
int read() {
  char c = getchar();
  int ans = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') ans = ans * 10 + c - '0', c = getchar();
  return ans;
}
void Write(int x) {
  if (x < 10)
    putchar(x ^ 48);
  else
    Write(x / 10), putchar((x % 10) ^ 48);
  return;
}
int min(int x, int y) { return x < y ? x : y; }
int main() {
  n = read(), m = read();
  for (register int i = 1; i <= m; i++) S[i] = read();
  green = read(), red = read();
  for (register int i = 1; i <= m; i++)
    for (register int j = 1; j <= green; j++) dist[i][j] = 2100000000;
  std::sort(S + 1, S + 1 + m);
  Q.push_front(std::make_pair(1, green));
  dist[1][green] = 0;
  inq[1][green] = 1;
  while (!Q.empty()) {
    std::pair<int, int> now = Q.front();
    int G = dist[now.first][now.second];
    Q.pop_front();
    inq[now.first][now.second] = 0;
    if (now.first < m) {
      int dis = S[now.first + 1] - S[now.first], rG;
      std::pair<int, int> nxt;
      if (now.second >= dis) {
        if (now.first + 1 == m)
          Ans = min(Ans, G + dis);
        else if (now.second == dis) {
          rG = G + dis + red;
          nxt = std::make_pair(now.first + 1, green);
          if (dist[nxt.first][nxt.second] > rG) {
            dist[nxt.first][nxt.second] = rG;
            if (!inq[nxt.first][nxt.second]) {
              inq[nxt.first][nxt.second] = 1;
              if (!Q.empty() && rG < dist[Q.front().first][Q.front().second])
                Q.push_front(nxt);
              else
                Q.push_back(nxt);
            }
          }
        } else {
          rG = G + dis;
          nxt = std::make_pair(now.first + 1, now.second - dis);
          if (dist[nxt.first][nxt.second] > rG) {
            dist[nxt.first][nxt.second] = rG;
            if (!inq[nxt.first][nxt.second]) {
              inq[nxt.first][nxt.second] = 1;
              if (!Q.empty() && rG < dist[Q.front().first][Q.front().second])
                Q.push_front(nxt);
              else
                Q.push_back(nxt);
            }
          }
        }
      }
    }
    if (now.first > 1) {
      int dis = S[now.first] - S[now.first - 1], rG;
      std::pair<int, int> nxt;
      if (now.second >= dis) {
        if (now.second == dis) {
          rG = G + dis + red;
          nxt = std::make_pair(now.first - 1, green);
          if (dist[nxt.first][nxt.second] > rG) {
            dist[nxt.first][nxt.second] = rG;
            if (!inq[nxt.first][nxt.second]) {
              inq[nxt.first][nxt.second] = 1;
              if (!Q.empty() && rG < dist[Q.front().first][Q.front().second])
                Q.push_front(nxt);
              else
                Q.push_back(nxt);
            }
          }
        } else {
          rG = G + dis;
          nxt = std::make_pair(now.first - 1, now.second - dis);
          if (dist[nxt.first][nxt.second] > rG) {
            dist[nxt.first][nxt.second] = rG;
            if (!inq[nxt.first][nxt.second]) {
              inq[nxt.first][nxt.second] = 1;
              if (!Q.empty() && rG < dist[Q.front().first][Q.front().second])
                Q.push_front(nxt);
              else
                Q.push_back(nxt);
            }
          }
        }
      }
    }
  }
  if (Ans < 2100000000)
    Write(Ans);
  else
    putchar('-'), putchar('1');
  return 0;
}
