The Unique Topological Sort#10652

The Unique Topological Sort

1 second
128 megabytes
Very easy

An unweighted directed acyclic graph is given. Determine whether it has a unique topological sort.

Input

The first line contains the number of vertices n~(1 \le n \le 2 \cdot 10^5) and the number of edges m~(1 \le m \le 10^5) in the graph. The following lines describe the edges of the graph, each represented by a pair of integers — the indices of the start and end vertices.

Output

Print "YES" if there is a unique topological sort of the vertices, and "NO" if there are multiple valid sorts. If a topological sort is impossible, print .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading