Road

No attempts yetTime limit2sMemory limit64 MB

Problem

A country has N cities numbered 1 through N. An engineer wants to build roads so that every city can reach every other city, passing through other cities on the way if needed.

His team surveyed M routes that could carry a road. Each route joins two cities in both directions, and paving a road along a route costs a fixed amount. The shorter the route, the cheaper it is.

The engineer did not plan the transport system in advance. He just picks a route he likes, paves a road on it, and repeats until every city is connected.

Right now he wants to pave the route between city p and city q. The government is pressing him to cut costs, so he asked you for a program that decides whether he may build that road. Print YES if a road network of the smallest possible total cost that connects every city can contain that road, and NO otherwise.

Input

The first line contains the number of test cases T. (T10T \le 10)

The first line of each test case contains the integers N, M, p, q. N (2N100002 \le N \le 10\,000) is the number of cities, M (1M200001 \le M \le 20\,000) is the number of routes, and p and q (1p,qN1 \le p, q \le N) are the two cities in question.

Each of the next M lines contains the integers u, v, w. (1uN1 \le u \le N, 1vN1 \le v \le N, 1w4000001 \le w \le 400\,000) The route joining city u and city v in both directions costs w.

Within one test case all route costs are different, and at most one route joins any pair of cities. The route between p and q is one of the M given routes. At least one road network connecting every city is guaranteed to exist. Every input value is an integer.

Output

Print one line per test case. Print YES if a road network of the smallest possible total cost can contain the road between p and q, and NO otherwise.