# Is it a Tree?

Very easy

Execution time limit is 1 second

Runtime memory usage limit is 128 megabytes

An undirected graph without loops and multiple edges is given by an adjacency matrix. Determine whether this graph is a tree.

## Input

The first line contains the number of vertices $n(1≤n≤100)$ in the graph. Then, an adjacency matrix of size $n×n$ is given, where $1$ indicates the presence of an edge, and $0$ indicates its absence. The matrix is symmetric with respect to the main diagonal.

## Output

Print "YES" if the graph is a tree, and "NO" otherwise.

## Examples

Input #1

Answer #1

Submissions 17K

Acceptance rate 31%