Given an undirected, unweighted graph, your task is to determine whether it is a tree.
The input begins with a single natural number (N \leq 100), representing the number of vertices in the graph. Following this, there are lines, each containing numbers, which form the adjacency matrix of the graph. In the -th row and -th column, a indicates that vertices and are connected by an edge, while a indicates no edge between them. The main diagonal of the matrix consists of zeros, and the matrix is symmetric about the main diagonal.
Print "YES" if the graph is a tree; otherwise, print "NO".
Example 1