Mission 1 - I : On the Way

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

P1016 Mission 1 - I : On the Way

Difficulty: 350\color{grey}350

Problem Background

Radar is now on the way to beat Cui2010.

But as we all know, Cui2010 is not a normal guy ~~(yeah, he's mad and crazy)~~, so the road is not so satisfying for him and us...

Problem Statement

The road is a long line which is LL kilometres long. Radar is currently at the mark 00, and because is rainy there and the road is not so flat, there's much water on the road and it form mm ponds. All the ponds have a constant depth and the one on mark ii have a depth of did_{i}.

Radar have his special shoes: one kind is to make him taller with aa metres (that is, to let him available to walk in ponds), and the other kind is to make him light (that is, to make him walk farther with bb steps at a time).

Radar is currently nn metres tall and can go 11 step at a time.

Radar can only wear one kind of his special shoes and he can't change to the other kind of shoes when he is on the road.

So, can Radar go to the mark LL from the mark 00?

Input

First 22 lines:

nn mm LL
aa bb

And then following mm lines, each line contains two elements:

ii did_{i}

Here means that at the mark ii there's a pond, and it's depth is did_i.

Output

If Radar can go to the mark LL from the mark 00 wearing one of his shoes on the road, print Yes; Otherwise print No.

Samples

Input 1

2 5 10
7 2
1 3
3 6
4 10
6 4
9 1

Output 1

Yes

In this Sample, Radar can go to mark L=10L=10 wearing the 2nd2^{nd} kind of shoes:

  • First, go 22 steps to mark 22.
  • Then, go 33 steps to mark 55.
  • Finally, because Radar can stand on every mark of the marks after without being drown, he can obviously go to mark L=10L=10.

Input 2

2 7 11
7 5
1 3
3 6
4 8
5 8
6 5
7 4
10 6

Output 2

Yes

In this Sample, Radar can go to mark L=11L=11 wearing the 1st1^{st} kind of shoes, and then he can stand on every mark of the road without drown, so he can obviously go to mark L=11L=11.

Input 3

2 7 12
4 2
2 8
3 1
5 2
7 10
8 11
9 12
11 100000

Output 3

No

Constraints

  • 2n102 \le n \le 10.
  • 5m(L)5 \le m \le \left(L\right).
  • 2L1502 \le L \le 150.
  • 1a501 \le a \le 50.
  • 1bmin{L2,10}1 \le b \le \min\left\{\left\lfloor\dfrac{L}{2}\right\rfloor, 10\right\}.
  • For the mm ii's, 1di<L1 \le d_{i} < L.

AOCode Round #2 (Div. 1) & AOSC #1 & GLOI Edu Round #1

未参加
状态
已结束
规则
OI
题目
5
开始于
2021-10-05 12:00
结束于
2021-10-07 22:00
持续时间
58.0 小时
主持人
参赛人数
7