In a connected social network, a Man in the Middle is a person whose departure disconnects the network. Report whether any such person exists.
The first line contains TTT test cases (T≤15T \le 15T≤15). Each test case gives NNN, MMM, and MMM friendship pairs.
Print YES if the network has a Man in the Middle, otherwise print NO.
YES
NO