Inferring gene duplications, transfers and losses can be done in a discrete framework