Type: Default 1000ms 256MiB

sort

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

排序

给你 m 对(aia_ibib_i),其中 1≤aia_i<bib_i≤n,我们定义如下程序来对一个排列进行排序: image

该程序也可以如下表示

image

判断这个程序是否能对所有长度为 n 的排列 p 进行排序。

输入

第一行包含两个整数 n 和 m(2≤n≤2×10410^4,1≤m≤2×10510^5)。

接下来 m 行,每行包含两个整数(aia_ibib_i)(1≤aia_i<bib_i≤n)。

输出

如果能对所有排列进行排序,输出 “Yes”,否则输出 “No”。

示例

标准输入

5 7
1 3
1 3
2 4
3 5
1 4
2 5
1 5

标准输出

No

标准输入

3 3
1 2
1 3
2 3

标准输出

Yes