Check if an element is in a list.