思考题 about poems

Is your love as confusing as the sun acquiesced?

Once a Chinese poem said:

There's sun in the east but rain in the west,
Is your love as confusing as the sun acquiesced?

Now you are given a undirected weighted graph G of N nodes and M edges. It is known that some edges are raining. Each edge has 5 parameters: means the node it connects from and to, the length of it, the raining delta and raining length.

A edge is raining from time to , then from to ... During these time, you are not allowed to pass it.

What's the minimum time to walk from 1 to N without getting wet? Assume that you go at time 0.

Constriants

Subtask 1(10%):li=1e9
Subtask 2(40%):Print "YES" if there exists a way, "NO" otherwise
For all:N,M<=1e5,di,bi,li<=1e9