#include <bits/stdc++.h>
using namespace std;
struct pt {
  long long pos, val;
};
long long dp[10010][1010], p[10010];
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
signed main() {
  long long n = read(), m = read();
  for (long long i = 1; i <= m; ++i) p[i] = read();
  long long g = read(), r = read();
  for (long long i = 1; i <= m; ++i) {
    for (long long j = 0; j <= g; ++j) dp[i][j] = 1 << 30;
  }
  sort(p + 1, p + 1 + m);
  deque<pt> q;
  q.push_back({1, g});
  dp[1][g] = 0;
  while (!q.empty()) {
    auto &s = q.front();
    long long pos = s.pos, val = s.val;
    long long tmp = dp[pos][val];
    q.pop_front();
    if (pos < m) {
      long long pos2 = pos + 1, d = p[pos2] - p[pos], val2 = val - d,
                tmp2 = tmp;
      if (val2 >= 0) {
        if (dp[pos2][val2] > tmp2) {
          dp[pos2][val2] = tmp2;
          q.push_front({pos2, val2});
        }
      }
    }
    if (pos > 1) {
      long long pos2 = pos - 1, d = -p[pos2] + p[pos], val2 = val - d,
                tmp2 = tmp;
      if (val2 >= 0) {
        if (dp[pos2][val2] > tmp2) {
          dp[pos2][val2] = tmp2;
          q.push_front({pos2, val2});
        }
      }
    }
    if (val == 0) {
      long long pos2 = pos, val2 = g, tmp2 = tmp + 1;
      if (dp[pos2][val2] > tmp2) {
        dp[pos2][val2] = tmp2;
        q.push_back({pos2, val2});
      }
    }
  }
  long long ans = 1 << 30;
  for (long long i = 0; i <= g; ++i) {
    if (dp[m][i] != 1 << 30) ans = min(ans, dp[m][i] * (r + g) + (g - i));
  }
  if (ans == 1 << 30)
    puts("-1");
  else
    cout << ans << endl;
  return 0;
}
