A map has n junctions, numbered 1 through n, joined by m two-way toll roads. Road i connects two distinct junctions and has a toll w_i. You are then given q queries. Each query gives a, b, and a limit, and asks: can you travel from junction a to junction b using only roads whose toll is strictly less than limit?
Answer each query with YES or NO, one per line, in the input order.
Input format
Output format
q lines, each YES or NO, answering the queries in order.
Constraints
- 2 <= n <= 100000
- 0 <= m <= 200000
- 1 <= q <= 200000
- 1 <= w, limit <= 1000000000
- 1 <= u, v, a, b <= n and u != v