Bugland is a country with cities. Being a newly founded country, the cities are not connected by any roads, thus the government decided to initiate a project which will last exactly days and whose purpose is to create a network of roads between the cities.
In each day of the project, the workers build two new weighted unidirectional roads, one from city to city whose weight is and one from city to city whose weight is .
After each day the inhabitants of Bugland ask themselves a question: is there a way of to label the cities with numbers such that if there is an edge from city to city , the weight of the edge is , where is the label of the city?
Input data
The first line will contain the number of cities and the number of days of the project . The next lines each contain three numbers describing the roads built in each day.
Output data
You will write lines, on the line YEP :)
if there is a way to number the cities, or NOPE :/
if there is none.
Constraints and clarifications
- For tests worth points: and
- Bugland can have multiple roads between two cities or roads form one city to itself.
Example 1
stdin
4 5
0 1 1
1 3 -1
3 0 0
3 2 4
2 0 3
stdout
YEP :)
YEP :)
YEP :)
YEP :)
NOPE :/