I suffer from gastric problems. Is it harmful to insert a finger into the anus when I defecate?

Is it harmful to insert a finger into the anus to remove stools?