import java.util.*; class Main { ArrayList[] graph; @SuppressWarnings("unchecked") Main() { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); this.graph = new ArrayList[n]; for (int i = 0; i < n; ++i) { this.graph[i] = new ArrayList(); } int m = scan.nextInt(); for (int i = 0; i < m; ++i) { int sa = scan.nextInt(); int sb = scan.nextInt(); this.graph[sa].add(sb); this.graph[sb].add(sa); } int numberOfOddVertices = 0; for (int i = 0; i < n; ++i) { if (graph[i].size() % 2 != 0) { numberOfOddVertices += 1; } } if (numberOfOddVertices > 2) { System.out.println("NO"); return; } // Henga renketu ka douka siraberu int start = 0; for (int i = 0; i < n; ++i) { if (graph[i].size() >= 1) { start = i; break; } } boolean[] visited = new boolean[n]; Queue queue = new ArrayDeque(); queue.add(start); while (queue.size() >= 1) { int vertex = queue.poll(); if (visited[vertex]) { continue; } visited[vertex] = true; for (int target: this.graph[vertex]) { queue.add(target); } } for (int i = 0; i < n; ++i) { if (graph[i].size() >= 1 && !visited[i]) { System.out.println("NO"); return; } } System.out.println("YES"); } public static void main(String[] args) { new Main(); } }