Added function to check that a list is a valid character bag.