The defendant, with the consent of the district attorney, may plead guilty of a lesser offense that is included in the offense charged in the indictment.