through the village to the town of Farmersville, where the two routes split. East of NY 16, NY 98 continues generally northeastward across rural terrain through the hamlets of Farmersville and Farmersville Station to an isolated junction east of the latter, where NY 98 intersects NY 243 at a T-intersection. While NY 243 leaves to the right (east), NY 98 turns left, initially heading northwest before curving to the north as it crosses into the town of Freedom. The route initially heads north toward the hamlet of the same name in the northeastern corner of the county, but ultimately bypasses the hamlet to the west to follow Clear Creek into Sandusky, the last settlement on NY 98 within the county. At the hamlet, NY 98 turns back to the northwest and crosses into Wyoming County and the town of Arcade. Across the county line, the amount of development along the route increases as NY 98 enters the village of Arcade on Liberty Street. In the center of the village, NY 98 turns east to overlap with NY 39 for two long blocks along Main Street. The two routes split at Water Street, with NY 98 following the street northward across Cattaraugus Creek to a junction with North Street in the lightly populated northern portion of the village. At this point, Water Street merges into North Street, and the latter parallels the Arcade and Attica Railroad (ARA) and Cattaraugus Creek as it carries NY 98 northeastward out of the village. NY 98 follows the creek to an area of farmlands known as Arcade Center, where the route and the railroad both turn north toward Java, a mostly rural town dominated by farmland. Java to Attica NY 98 heads virtually due north through Java, remaining in close proximity to the ARA up to the hamlet of Java Center. NY 98 crosses the railroad at a grade crossing just south of the hamlet before meeting NY 77 and NY 78 at a four-way junction in the center of the community. NY 77 continues north from the intersection on Cattaraugus Road while NY 98 joins NY 78 eastward on Main Street, traversing the ARA at another grade crossing on their way out of the hamlet. The overlap extends for across farmlands and through forests to a point once known as Five Corners, where NY 98 separates from NY 78 and turns northward once more.