What is masturbation? And is this halal ya haram?

Masturbation is a act when a person has ejaculated semen by either touching his private parts or having seen na mahram woman’s photos. In all cases Masturbation is haram and it causes an addiction for a person which might ruin his life in future.