Check if the list elements are equal