John R. Trice, Elmira, for appellant. F. Paul Battisti, District Attorney, Binghamton (Joann Rose Parry of counsel), for respondent. Appeal from a judgment of the County Court of Broome County (Joseph F. Cawley, J.), rendered January 5, 2022, convicting defendant upon his plea of guilty of the crime of rape in the first degree. In September 2015, defendant was indicted and charged with burglary in the first degree as a sexually motivated felony and rape in the first degree, stemming from an incident wherein defendant unlawfully entered the victim’s home and raped her. In 2016, following a mental competency hearing conducted pursuant to CPL 730.30, County Court determined that defendant was an incapacitated person (see CPL 730.10 [1]) and an order of commitment was entered. Defendant was found to be incapacitated following hearings in 2017, 2018 and 2019 as well, and orders of subsequent retention were entered. In 2021, after the maximum time period of the 2019 retention order had expired, defendant did not request subsequent retention, informing County Court that his expert had found him to no longer be incapacitated and that he was not seeking any further hearings as to his competency. Defendant thereafter pleaded guilty to rape in the first degree — in full satisfaction of the underlying indictment — with the understanding that he would be sentenced to a prison term of 15 years followed by 20 years of postrelease supervision. The plea agreement also required defendant to waive his right to appeal. County Court imposed the agreed-upon term of imprisonment, and this appeal ensued. We affirm. We reject defendant’s challenge to the validity of his appeal waiver. Initially, nothing in the plea colloquy suggests that defendant’s mental issues impaired his ability to understand the nature and ramifications of the waiver. Further, the record reflects that defendant was advised that a waiver of the right to appeal was a term and condition of the plea agreement, and County Court explained the separate and distinct nature of the waiver, which defendant affirmed he understood (see People v. Robinson, 213 AD3d 1002, 1002-1003 [3d Dept 2023]; People v. Stockwell, 203 AD3d 1407, 1408 [3d Dept 2022], lv denied 38 NY3d 1036 [2022]). Defendant also executed a detailed written waiver, assuring the court that he had read the waiver, discussed it with counsel and understood its contents. Although the written waiver included some overbroad language, it also advised defendant of the appellate rights that were not encompassed by the waiver, and we are satisfied that defendant understood the distinction that some appellate review survived (see People v. Gincerowski, 205 AD3d 1152, 1153 [3d Dept 2022]; People v. Hernandez, 188 AD3d 1357, 1358 [3d Dept 2020], lv denied 36 NY3d 1057 [2021]). Accordingly, we find that defendant’s appeal waiver was knowing, intelligent and voluntary (see People v. Wint, 222 AD3d 1050, 1051 [3d Dept 2023], lv denied 41 NY3d 945 [2024]; People v. Marshall, 206 AD3d 1377, 1378 [3d Dept 2022], lv denied 39 NY3d 941 [2022]). In light of defendant’s valid appeal waiver, his challenge to the severity of his sentence is precluded (see People v. Cook, 219 AD3d 1022, 1023 [3d Dept 2023], lv denied 40 NY3d 1080 [2023]; People v. Hurd, 217 AD3d 1268, 1268-1269 [3d Dept 2023]). Aarons, J.P., Lynch, Ceresia, McShan and Powers, JJ., concur. ORDERED that the judgment is affirmed.