import java.util.* ;
public class pp_tgr {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in) ;
      int n = sc.nextInt() ;
      long small = sc.nextLong() ;
      long large = sc.nextLong() ;
      long u = large - small, v = small * n ;
      long p[] = new long[n] ;
      for (int i=0; i<n; i++)
         p[i] = sc.nextLong() ;
      Arrays.sort(p) ;
      for (int i=1; i<n; i++) {
         long g = 2 * (p[i] - p[i-1] - small) ;
         if (g < 0) {
            System.out.println(-1) ;
            System.exit(0) ;
         }
         v += Math.min(u, g) ;
         u = Math.min(large - small, Math.max(0, g - u)) ;
      }
      System.out.println(u+v) ;
   }
}
