#P1415F. Cakes for Clones

Cakes for Clones

Description

You live on a number line. You are initially (at time moment t=0t = 0) located at point x=0x = 0. There are nn events of the following type: at time tit_i a small cake appears at coordinate xix_i. To collect this cake, you have to be at this coordinate at this point, otherwise the cake spoils immediately. No two cakes appear at the same time and no two cakes appear at the same coordinate.

You can move with the speed of 11 length unit per one time unit. Also, at any moment you can create a clone of yourself at the same point where you are located. The clone can't move, but it will collect the cakes appearing at this position for you. The clone disappears when you create another clone. If the new clone is created at time moment tt, the old clone can collect the cakes that appear before or at the time moment tt, and the new clone can collect the cakes that appear at or after time moment tt.

Can you collect all the cakes (by yourself or with the help of clones)?

The first line contains a single integer nn (1n50001 \le n \le 5000) — the number of cakes.

Each of the next nn lines contains two integers tit_i and xix_i (1ti1091 \le t_i \le 10^9, 109xi109-10^9 \le x_i \le 10^9) — the time and coordinate of a cake's appearance.

All times are distinct and are given in increasing order, all the coordinates are distinct.

Print "YES" if you can collect all cakes, otherwise print "NO".

Input

The first line contains a single integer nn (1n50001 \le n \le 5000) — the number of cakes.

Each of the next nn lines contains two integers tit_i and xix_i (1ti1091 \le t_i \le 10^9, 109xi109-10^9 \le x_i \le 10^9) — the time and coordinate of a cake's appearance.

All times are distinct and are given in increasing order, all the coordinates are distinct.

Output

Print "YES" if you can collect all cakes, otherwise print "NO".

Sample Input 1

3
2 2
5 5
6 1

Sample Output 1

YES

Sample Input 2

3
1 0
5 5
6 2

Sample Output 2

YES

Sample Input 3

3
2 1
5 5
6 0

Sample Output 3

NO

Note

In the first example you should start moving towards 55 right away, leaving a clone at position 11 at time moment 11, and collecting the cake at position 22 at time moment 22. At time moment 55 you are at the position 55 and collect a cake there, your clone collects the last cake at time moment 66.

In the second example you have to leave a clone at position 00 and start moving towards position 55. At time moment 11 the clone collects a cake. At time moment 22 you should create a new clone at the current position 22, it will collect the last cake in future. You will collect the second cake at position 55.

In the third example there is no way to collect all cakes.