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.
The first line contains the number of test cases T. (T≤10)
The first line of each test case contains the integers N, M, p, q. N (2≤N≤10000) is the number of cities, M (1≤M≤20000) is the number of routes, and p and q (1≤p,q≤N) are the two cities in question.
Each of the next M lines contains the integers u, v, w. (1≤u≤N, 1≤v≤N, 1≤w≤400000) 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.
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.