An undirected, unweighted graph is provided.
Your task is to determine if this graph is a tree.
The first line of the input contains 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 means there is no edge. The main diagonal of the matrix consists of zeros, and the matrix is symmetric with respect to the main diagonal.
Print "YES" if the graph is a tree, and "NO" otherwise.
Example 1