How can I prevent a user from selecting exactly one of two (not both or none) categories on a post?

How can I prevent a user from selecting exactly one of two (not both or none) categories on a post?