Wishmaster

Wishmaster, the demonic jinn is back to the city of Byteland to fulfill wishes of all the people in the city. As people of Byteland are patriot, they want Wishmaster to do something for their country. They want a remedy of the traffic jam of the city so they can participate in Codejam timely every year. Coincidentally, Wishmaster has N magical powers and Byteland also has N (1 to N) route. Wishmaster can convert a magical power into anything he wants. There are M person in the city. Everyone in city will make exactly two wishes to Wishmaster. A wish will be to build a flyover over theroutei(1≤i≤N)ortobuildasubwaybelowtheroutei(1≤i≤N). Wishmasterwillbuild either a subway or a flyover, but not both, in a route with a magical power. If Wishmaster fulfills both wishes of at least one person then he will become an angel. But, as he is still a demonic jinn, he is planning to remain demonic and wants to find a way not to fulfill both wishes of any person. Given wishes of M persons, help Wishmaster to determine whether he can avoid fulfilling both wishes of any of them. Note that he must build a flyover or subway but not both on each route. Input Input starts with an integer T (≤ 100), denoting the number of test cases. Each case starts with a line containing two integers N (1 ≤ N ≤ 100000) and M (0 ≤ M ≤ 100000), where N denotes the number routes and M denotes the number of persons in the city. Next M lines will contain two non-zero integers Wi1 and Wi2 (−N ≤ Wi1,Wi2 ≤ N), where Wij denotes the j-th wish of person i. A negative Wij represents that person i wants a subway below route |Wij| and a positive Wij represents that person i wants a flyover over route |Wij|. Output For each case, print the case number and ‘Yes’ or ‘No’, depending on whether it’s possible to avoid fulfilling both wishes of any person. Sample Input 2 35 -1 2 13 3 -2 1 -3 -2 -3 44 -1 2 13 -2 4 -3 -4 Sample Output Case 1: No

2/2 Case 2: Yes