
    The People of the State of New York, Respondent, v Julius Graves, Appellant.
    [945 NYS2d 910]
   Appeal from a judgment of the Erie County Court (Sheila A. DiTullio, J), rendered December 13, 2010. The judgment convicted defendant, upon his plea of guilty, of criminal possession of a weapon in the second degree, criminal possession of a weapon in the third degree and trespass.

It is hereby ordered that the judgment so appealed from is unanimously modified on the law by vacating the sentence imposed for trespass under count three of the indictment and as modified the judgment is affirmed, and the matter is remitted to Erie County Court for resentencing on that count of the indictment.

Memorandum: Defendant appeals from a judgment convicting him upon his plea of guilty of criminal possession of a weapon in the second degree (Penal Law § 265.03 [3]), criminal possession of a weapon in the third degree (§ 265.02 [3]) and trespass (§ 140.05). “Despite defendant’s contention to the contrary, the record ‘establishes] that [he] understood that the right to appeal is separate and distinct from those rights automatically forfeited upon a plea of guilty’ ” (People v Lyons, 86 AD3d 930, 930 [2011], lv denied 17 NY3d 954 [2011], quoting People v Lopez, 6 NY3d 248, 256 [2006]; see People v Gleen, 73 AD3d 1443, 1443-1444 [2010], lv denied 15 NY3d 773 [2010]). We conclude that defendant’s waiver of the right to appeal was knowingly, intelligently and voluntarily entered (see Lopez, 6 NY3d at 256; Gleen, 73 AD3d at 1444). Contrary to defendant’s further contention, the valid waiver of the right to appeal encompasses his challenge to the severity of the sentence inasmuch as County Court informed defendant of the sentencing promise before he waived the right to appeal (see Lopez, 6 NY3d at 255-256; People v Lococo, 92 NY2d 825, 827 [1998]; People v Hidalgo, 91 NY2d 733, 737 [1998]).

As the People correctly concede, however, the sentence of a definite term of incarceration of one year for the violation of trespass is illegal (see Penal Law § 70.15 [4]), and defendant’s challenge to the legality of the sentence is not foreclosed by the valid waiver of the right to appeal (see People v Seaberg, 74 NY2d 1, 9 [1989]). We therefore modify the judgment by vacating the sentence imposed on count three of the indictment, and we remit the matter to County Court for resentencing on that count. Present — Scudder, P.J., Centra, Fahey, Peradotto and Sconiers, JJ.  