Removable singularities for analytic or subharmonic functions