Scenery

Given n time windows and a fixed photo duration t, decide whether all photos can be scheduled as non-overlapping intervals.

Medium6GreedySortingIntervalsImplementationInterviewNo attempts yetTime limit6sMemory limit512 MB

Problem

Images by John Fowler, Carol Highsmith, and Richard Woodland

You spend one day of a trip to Rapid City photographing the South Dakota Badlands, a place known for its unusual land formations. You are an amateur photographer and very particular about light, so you picked one spot with a wide view and listed nn features you want to photograph from it.

Feature ii only looks the way you want while the sun sits in the right range of positions. You may start that photograph no earlier than time aia_i, and it must be finished by time bib_i. Repositioning the tripod and the camera takes a while, so every photograph takes exactly tt units of time. You photograph one feature at a time and never interrupt a photograph once it has started, so a photograph begun at time ss occupies the whole interval from ss to s+ts + t.

Decide whether you can photograph all nn features in one day.

Input

The first line contains two integers nn and tt (1n1041 \le n \le 10^4, 1t1051 \le t \le 10^5), where nn is the number of photographs you want and tt is the time one photograph takes.

Each of the next nn lines describes the time window of one photograph with two integers aa and bb (0a0 \le a, a+tb109a + t \le b \le 10^9). You may begin that photograph no earlier than aa, and it must be finished by bb.

Output

Print yes if all nn photographs can be taken, and no otherwise.