import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[] counts = new int[n]; UnionFindTree uft = new UnionFindTree(n); for (int i = 0; i < m; i++) { int a = sc.nextInt(); int b = sc.nextInt(); uft.unite(a, b); counts[a]++; counts[b]++; } int count = 0; for (int x : counts) { count += x % 2; } boolean flag = (count <= 2 && uft.isOne()); if (flag) { System.out.println("YES"); } else { System.out.println("NO"); } } static class UnionFindTree { int[] parents; int[] counts; public UnionFindTree(int size) { parents = new int[size]; counts = new int[size]; for (int i = 0; i < size; i++) { parents[i] = i; counts[i] = 1; } } public int find(int x) { if (x == parents[x]) { return x; } else { return parents[x] = find(parents[x]); } } public boolean same(int x, int y) { return find(x) == find(y); } public void unite(int x, int y) { if (!same(x, y)) { counts[find(y)] += counts[find(x)]; counts[find(x)] = 0; parents[find(x)] = find(y); } } public boolean isOne() { int count = 0; for (int i = 0; i < counts.length; i++) { if (counts[i] > 1) { count++; } } return count <= 1; } } }