Check if the addresses passed are valid.