Appeal from a judgment and an adjudication of the Erie County Court (Michael L. D’Amico, J.), rendered August 8, 2006. Defendant was convicted upon his plea of guilty of criminal possession of stolen property in the fifth degree, reckless endangerment in the first degree, and attempted robbery in the third degree, and defendant was adjudicated a youthful offender upon his plea of guilty of robbery in the first degree.
It is hereby ordered that the judgment so appealed from is unanimously reversed on the law, the conviction is deemed vacated and replaced by a youthful offender finding, and the sentences of imprisonment of V-fe to 4 years imposed on counts three and four of the superior court information are directed to run concurrently with the sentence imposed on count one of the superior court information, and the adjudication is modified on the law by directing that the sentence imposed on count one of the superior court information shall run concurrently with the sentences imposed on counts three and four of the superior court information and as modified the adjudication is affirmed.
Memorandum: Defendant appeals from a youthful offender adjudication, based upon his plea of guilty, of robbery in the first degree (Penal Law § 160.15 [3]) and from a judgment convicting him upon his plea of guilty of criminal possession of stolen property in the fifth degree (§ 165.40), reckless endangerment in the first degree (§ 120.25), and attempted robbery in the third degree (§§ 110.00, 160.05). We reject the contention of defendant that his waiver of the right to appeal was invalid (see People v Ludlow, 42 AD3d 941 [2007]). County Court was not required to “ ‘engage in any particular litany’ when accepting [the] defendant’s waiver of the right to appeal” (id. at 942, quoting People v Callahan, 80 NY2d 273, 283 [1992]), and the record establishes that defendant’s waiver of the right to appeal was voluntarily, knowingly, and intelligently entered (see People *1132v Hidalgo, 91 NY2d 733, 737 [1998]). The valid waiver by defendant of the right to appeal encompasses his challenge to the severity of the sentence (see People v Lopez, 6 NY3d 248, 255-256 [2006]; Hidalgo, 91 NY2d at 737).
We conclude, however, that the sentence imposed pursuant to the plea agreement is illegal. A challenge to the legality of a sentence is not precluded by a defendant’s waiver of the right to appeal (see People v Seaberg, 74 NY2d 1, 10 [1989]; People v Coleman, 23 AD3d 1033 [2005]), and we reach the issue despite defendant’s failure to raise it at sentencing or on appeal inasmuch as “we cannot allow an [illegal] sentence to stand” (People v Davis, 37 AD3d 1179, 1180 [2007], lv denied 8 NY3d 983 [2007] [internal quotation marks omitted]). “Where an eligible youth is convicted of two or more crimes set forth in separate counts of an accusatory instrument . . . , the court must not find him a youthful offender with respect to any such conviction . . . unless it finds him a youthful offender with respect to all such convictions” (CPL 720.20 [2]; see People v Huther, 78 AD2d 1011 [1980]). Here, defendant was convicted of “two or more crimes set forth in separate counts of an accusatory instrument” (CPL 720.20 [2]) and, thus, upon adjudicating him a youthful offender with respect to robbery in the first degree under count one of the superior court information, the court was required to adjudicate him a youthful offender with respect to the remaining counts (see Huther, 78 AD2d at 1011). Moreover, having adjudicated defendant a youthful offender, the court “was without authority to impose consecutive sentences in excess of four years” (People v Ralph W.C., 21 AD3d 904, 905 [2005]; see Penal Law § 60.02 [2]; People v Simmons, 188 AD2d 668, 669 [1992], lv denied 81 NY2d 893 [1993]). We therefore reverse the judgment and modify the adjudication accordingly. Present—Martoche, J.P., Smith, Centra, Peradotto and Green, JJ.