传统题 1000ms 128MiB

Travel

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Problem Description


DSB is visiting a friend. 

DSB's house is located at point 0, and his friend's house is located at point m on an axis. 

DSB can use teleports to move along the axis. 

To use a teleport, DSB should come to a certain point (where the teleport is located) and choose where to move: for each teleport there is the rightmost point it can move DSB to, this point is known as the limit of the teleport. Formally, a teleport located at point x with limit y can move DSB from point x to any point within the segment [x; y], including the bounds.

Determine if DSB can visit the friend using teleports only, or he should use his car.



Input Format

The first line contains two integers n and m (1 ≤ n ≤ 100, 1 ≤ m ≤ 100) — the number of teleports and the location of the friend's house. 

The next n lines contain information about teleports. 

The i-th of these lines contains two integers ai and bi (0 ≤ ai ≤ bi ≤ m), where ai is the location of the i-th teleport, and bi is its limit. 

Output Format

Print "YES" if there is a path from DSB's house to his friend's house that uses only teleports, and "NO" otherwise.
样例1:
3 5
0 2
2 4
3 5

样例2:
3 7
0 4
2 5
6 7
样例1:
YES

样例2:
NO

Hint

2017级河南工大新生周赛总决赛(重现)

未参加
状态
已结束
规则
XCPC
题目
10
开始于
2018-12-26 0:00
结束于
2018-12-27 7:00
持续时间
31 小时
主持人
参赛人数
18