A characterization of some probability distributions