#include <bits/stdc++.h>
using namespace std;
int a[10010];
bool vis[10001][1001];
bool vis1[10001][1001];
int n, m, r, g;
bool dfs(int x, int nm) {
  if (vis1[x][nm]) {
    return 0;
  }
  vis1[x][nm] = 1;
  if (n - a[x] <= nm) {
    return 1;
  }
  if (nm == 0) {
    return dfs(x, g);
  }
  if (x > 0) {
    if (a[x] - a[x - 1] <= nm) {
      if (dfs(x - 1, nm - (a[x] - a[x - 1]))) return 1;
    }
  }
  if (a[x + 1] - a[x] <= nm) {
    if (dfs(x + 1, nm - (a[x + 1] - a[x]))) return 1;
  }
  return 0;
}
int main() {
  while (cin >> n >> m) {
    int ans = 0;
    for (int i = 0; i < m; ++i) {
      scanf("%d", a + i);
    }
    sort(a, a + m);
    scanf("%d%d", &g, &r);
    deque<pair<int, pair<int, int>>> q;
    q.push_back(make_pair(0, make_pair(g, 0)));
    pair<int, pair<int, int>> tmp;
    ans = 1e9;
    while (!q.empty()) {
      tmp = q.back();
      q.pop_back();
      if (vis[tmp.second.second][tmp.second.first]) {
        continue;
      }
      if (n - a[tmp.second.second] <= tmp.second.first) {
        ans = min(ans, tmp.first * (r + g) + n - a[tmp.second.second]);
        continue;
      }
      vis[tmp.second.second][tmp.second.first] = 1;
      if (tmp.second.first == 0) {
        q.push_front(make_pair(tmp.first + 1, make_pair(g, tmp.second.second)));
      } else {
        if (a[tmp.second.second + 1] - a[tmp.second.second] <=
            tmp.second.first) {
          if (!vis[tmp.second.second + 1]
                  [tmp.second.first -
                   (a[tmp.second.second + 1] - a[tmp.second.second])])
            q.push_back(make_pair(
                tmp.first,
                make_pair(tmp.second.first -
                              (a[tmp.second.second + 1] - a[tmp.second.second]),
                          tmp.second.second + 1)));
        }
        if (tmp.second.second > 0) {
          if (a[tmp.second.second] - a[tmp.second.second - 1] <=
              tmp.second.first) {
            if (!vis[tmp.second.second - 1]
                    [tmp.second.first -
                     (a[tmp.second.second] - a[tmp.second.second - 1])])
              q.push_back(make_pair(
                  tmp.first,
                  make_pair(tmp.second.first - (a[tmp.second.second] -
                                                a[tmp.second.second - 1]),
                            tmp.second.second - 1)));
          }
        }
      }
    }
    if (ans == 1e9) {
      ans = -1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
