#include <bits/stdc++.h>
using namespace std;
vector<string> vec_splitter(string s) {
  s += ',';
  vector<string> res;
  while (!s.empty()) {
    res.push_back(s.substr(0, s.find(',')));
    s = s.substr(s.find(',') + 1);
  }
  return res;
}
void debug_out(vector<string> __attribute__((unused)) args,
               __attribute__((unused)) int idx,
               __attribute__((unused)) int LINE_NUM) {
  cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
const int LOG = 18;
const int NN = (int)1e4 + 5;
const int MAXN = (int)60000 + 5;
const int INF = 1 << 29;
const long long MAX = (long long)1e18 + 5;
const int MOD = 1000;
long long mul(long long x, long long y) { return (1LL * x * y) % MOD; }
long long add(long long x, long long y) {
  long long res = x;
  res += y;
  return (res % MOD + MOD) % MOD;
}
int two(int x) { return 1 << x; }
bool contain(int mask, int bit) { return (mask & two(bit)) > 0; }
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int bit_count(int x) { return x == 0 ? 0 : (x & 1) + bit_count(x >> 1); }
int n, m;
int d[NN];
int G, R;
int dist[1005][NN];
int main() {
  ios_base::sync_with_stdio(false);
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) scanf("%d", &d[i]);
  sort(d, d + m);
  scanf("%d%d", &G, &R);
  memset(dist, -1, sizeof(dist));
  int ans = -1;
  deque<int> q;
  q.push_front(0);
  q.push_front(0);
  dist[0][0] = 0;
  while (!q.empty()) {
    int g = q.front();
    q.pop_front();
    int pos = q.front();
    q.pop_front();
    if (pos == m - 1) {
      int cost =
          g == 0 ? (R + G) * dist[g][pos] - R : (R + G) * dist[g][pos] + g;
      if (ans == -1 || ans > cost) {
        ans = cost;
      }
      continue;
    }
    if (g == G) {
      if (dist[0][pos] == -1) {
        dist[0][pos] = dist[g][pos] + 1;
        q.push_back(0);
        q.push_back(pos);
      }
    } else {
      if (pos > 0) {
        int diff = d[pos] - d[pos - 1];
        if (g + diff <= G && (dist[g + diff][pos - 1] == -1)) {
          dist[g + diff][pos - 1] = dist[g][pos];
          q.push_front(pos - 1);
          q.push_front(g + diff);
        }
      }
      if (pos + 1 < m) {
        int diff = d[pos + 1] - d[pos];
        if (g + diff <= G && (dist[g + diff][pos + 1] == -1)) {
          dist[g + diff][pos + 1] = dist[g][pos];
          q.push_front(pos + 1);
          q.push_front(g + diff);
        }
      }
    }
  }
  printf("%d\n", ans);
}
