#include <bits/stdc++.h>
using namespace std;
const int maxN = 100005;
class Debugger {
 public:
  template <typename T>
  void printVector(vector<T> const &vec, bool printSize = true) {
    if (printSize) {
      cout << vec.size() << endl;
    }
    for (auto &elem : vec) {
      cout << elem << " ";
    }
    cout << endl;
  }
  template <typename T>
  void printMatrix(vector<vector<T>> const &matrix) {
    cout << matrix.size() << " ";
    if (!matrix.empty()) {
      cout << matrix[0].size();
    }
    cout << endl;
    for (auto &vec : matrix) {
      printVector(vec, false);
    }
    cout << endl;
  }
};
class TaskE {
 private:
  Debugger debugger;
  int slots, coins;

 public:
  void solveOne(int it) {
    int n, m;
    cin >> n >> m;
    vector<int> places(m);
    for (int i = 0; i < m; i++) {
      cin >> places[i];
    }
    int green, red;
    cin >> green >> red;
    sort(places.begin(), places.end());
    int INF = 1e9;
    vector<vector<int>> d(m, vector<int>(green + 1, INF));
    deque<pair<int, int>> q;
    q.push_back({0, 0});
    d[0][0] = 0;
    while (!q.empty()) {
      auto curr = q.front();
      q.pop_front();
      int index = curr.first;
      int g = curr.second;
      if (index > 0) {
        int dif = places[index] - places[index - 1];
        if (g + dif <= green and d[index][g] < d[index - 1][g + dif]) {
          d[index - 1][g + dif] = d[index][g];
          q.push_front({index - 1, g + dif});
        }
      }
      if (index + 1 < m) {
        int dif = places[index + 1] - places[index];
        if (g + dif <= green and d[index][g] < d[index + 1][g + dif]) {
          d[index + 1][g + dif] = d[index][g];
          q.push_front({index + 1, g + dif});
        }
      }
      if (g == green) {
        if (d[index][g] + 1 < d[index][0]) {
          d[index][0] = d[index][g] + 1;
          q.push_back({index, 0});
        }
      }
    }
    long long ans = -1;
    for (int u = 0; u < m; u++) {
      if (places[m - 1] - places[u] > green) {
        continue;
      }
      int g = 0;
      if (d[u][g] >= INF) {
        continue;
      }
      if (ans == -1 or
          (long long) d[u][g] * (green + red) + places[m - 1] - places[u] <
              ans) {
        ans = (long long)d[u][g] * (green + red) + places[m - 1] - places[u];
      }
    }
    cout << ans << endl;
  }
  void solve() {
    int tc = 1;
    for (int it = 1; it <= tc; it++) {
      solveOne(it);
    }
  }
};
int main() {
  TaskE solver;
  solver.solve();
  return 0;
}
