In a statement , the military said militants were shaving off their beards and cutting their hair -- flowing locks were fashionable among the Swat Taliban -- in order to escape by mingling with the refugees pouring out of the valley .