Problem Statement
Takahashi is exploring a cave in a video game.
The cave consists of NN rooms arranged in a row. The rooms are numbered Room 1,2,\ldots,N1,2,…,N from the entrance.
Takahashi is initially in Room 11, and the time limit is TT.
For each 1 \leq i \leq N-11≤i≤N−1, he may consume a time of A_iAi to move from Room ii to Room (i+1)(i+1). There is no other way to move between rooms. He cannot make a move that makes the time limit 00 or less.
There are MM bonus rooms in the cave. The ii-th bonus room is Room X_iXi; when he arrives at the room, the time limit increases by Y_iYi.
Can Takahashi reach Room NN?
Constraints
-
2 \leq N \leq 10^52≤N≤105
-
0 \leq M \leq N-20≤M≤N−2
-
1 \leq T \leq 10^91≤T≤109
-
1 \leq A_i \leq 10^91≤Ai≤109
-
1 < X_1 < \ldots < X_M < N1<X1<…<XM<N
-
1 \leq Y_i \leq 10^91≤Yi≤109
-
All values in input are integers.