1364: Travel

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:162 解决:33

题目描述


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.

DSBcan use teleports to move along the axis.

To use a teleport,DSBshould 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 moveDSBto, this point is known as the limit of the teleport. Formally, a teleport located at point x with limit y can moveDSBfrom 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.



输入

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.

输出

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

提示

Baidu
map