Ada is wondering in her dreamland. Her dreamland consists of n spots. She has this weird machine with her that shows real numbers. And whenever she goes from spot u to v, if she can (by following a trail), the value shown in the machine gets multiplied with which is another weird value for each trail that exists between two spots.
Ada is currently in spot 1 and her machine currently reads value d. She wants to go to spot n in a way so that the machine shows zero when she reaches n. Is that possible?
Please note that, Ada can visit a spot multiple times if it helps her.
Ada's machine displays zero when the value is either zero or tends to be zero. To say that x tends to zero is to say that x varies in such a way that its numerical value becomes and remains less than any positive number that we may choose, no matter how small.
First line contains two integers and one positive real number (), (), (); the number of spots, the number of trails, the initial reading of the machine respectively.
Each of the next m lines contains two integers , () and a positive real number (); which corresponds to a trail from spot to spot with the multiplier .
and will have exactly 2 digits after the decimal place.
Note that the trails are unidirectional. Also, there will be no trail from a spot to itself. And there exists at most one trail from a spot to .
If Ada can not reach spot anyhow, please output "Unreachable" on a line. Else, print "Yes" if she can obtain zero at the machine reading after arriving in spot . Print "No" otherwise.
Input | Output |
---|---|
5 5 1.00 1 2 0.10 2 3 7.00 2 4 2.00 4 3 0.90 3 5 0.05 | No |
There are two ways to go to 5 from 1: A. 1-2-3-5 yields a value of 1 × 0.10 × 7.00 × 0.05 = 0.035. B. 1-2-4-3-5 yields a value of 1 × 0.10 × 2.00 × 0.90 × 0.05 = 0.09. None of them yields 0. |