import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
= new Scanner
(System.
in); int m,n,f,l;
boolean p=true;
n=in.nextInt();
m=in.nextInt();
int[] a = new int[n];
for (int i=0; i<m; i++){
f=in.nextInt();
l=in.nextInt();
a[f-1]++; a[l-1]++;
}
for (int i=0; i<n; i++){if (a[i]!=a[0]){p=false; break;}}
if (p
) System.
out.
println("YES"); else System.
out.
println("NO"); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJaW50IG0sbixmLGw7IAoJCWJvb2xlYW4gcD10cnVlOwoJCW49aW4ubmV4dEludCgpOwoJCW09aW4ubmV4dEludCgpOwoJCWludFtdIGEgPSBuZXcgaW50W25dOwoJCWZvciAoaW50IGk9MDsgaTxtOyBpKyspewoJCQlmPWluLm5leHRJbnQoKTsKCQkJbD1pbi5uZXh0SW50KCk7CgkJCWFbZi0xXSsrOyBhW2wtMV0rKzsKCQl9CgkJZm9yIChpbnQgaT0wOyBpPG47IGkrKyl7aWYgKGFbaV0hPWFbMF0pe3A9ZmFsc2U7IGJyZWFrO319CgkJaWYgKHApIFN5c3RlbS5vdXQucHJpbnRsbigiWUVTIik7CgkJZWxzZSBTeXN0ZW0ub3V0LnByaW50bG4oIk5PIik7Cgl9Cn0=