Check if the array contains the given element.