import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] counts = new int[n]; UnionFindTree uft = new UnionFindTree(n); HashSet set = new HashSet<>(); for (int i = 0; i < m; i++) { int x = sc.nextInt(); int y = sc.nextInt(); counts[x]++; counts[y]++; uft.unite(x, y); set.add(x); set.add(y); } boolean flag = true; int parent = -1; for (int x : set) { int y = uft.find(x); if (parent != -1 && parent != y) { flag = false; break; } parent = y; } int od = 0; for (int i = 0; i < n; i++) { if (counts[i] % 2 == 1) { od++; } } if (od > 2 || !flag) { System.out.println("NO"); } else { System.out.println("YES"); } } static class UnionFindTree { int[] parents; public UnionFindTree(int size) { parents = new int[size]; for (int i = 0; i < size; i++) { parents[i] = i; } } public int find(int x) { if(parents[x] == x) { return x; } else { return parents[x] = find(parents[x]); } } public void unite(int x, int y) { int xx = find(x); int yy = find(y); if (xx == yy) { return; } parents[xx] = yy; } } }