Convicted sex offender sentenced after prosecutors drop two dozen charges in York