Problem2221--abc240C - Jumping Takahashi

2221: abc240C - Jumping Takahashi

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Time Limit: 2 sec / Memory Limit: 1024 MB

Score : 300300 points

Problem Statement

Takahashi is standing at the coordinate 00 on a number line.
He will now perform NN jumps. In the ii-th jump (1 \leq i \leq N)(1iN), he moves a_iai or b_ibi in the positive direction.
Is it possible for him to be at the coordinate XX after NN jumps?

Constraints

  • 1 \leq N \leq 1001N100
  • 1 \leq a_i \lt b_i \leq 100 \, (1 \leq i \leq N)1ai<bi100(1iN)
  • 1 \leq X \leq 100001X10000
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:
NNXXa_1a1b_1b1\vdotsa_NaNb_NbN

Output

If it is possible for Takahashi to be at the coordinate XX after NN jumps, print Yes; otherwise, print No.

Sample Input Copy

2 10
3 6
4 5

Sample Output Copy

Yes

HINT

By moving b_1 (= 6)b1(=6) in the first jump and a_2 (= 4)a2(=4) in the second jump, he can be at the coordinate X (= 10)X(=10).

Source/Category