import core.bitop; import std.algorithm; import std.array; import std.ascii; import std.container; import std.conv; import std.format; import std.math; import std.range; import std.stdio; import std.string; import std.typecons; void main() { auto v = readln.chomp.split.map!(to!int); int n = v.front; int m = v.back; int[][] adj = new int[][](n); foreach (i; 0..m) { auto s = readln.chomp.split.map!(to!int); int a = s.front; int b = s.back; adj[a] ~= b; adj[b] ~= a; } bool[] done = new bool[](n); done[0] = true; int[] list = [0]; int[] queue = [0]; while (queue.length) { int node = queue.front; queue = queue[1..$]; foreach (next; adj[node]) { if (done[next]) { continue; } done[next] = true; list ~= next; queue ~= next; } } auto cnt = list.map!(a => adj[a].length).filter!(a => a % 2 == 1).count; bool ans = !done.any!(a => !a) && (cnt == 0 || cnt == 2); enum R = ["NO", "YES"]; R[ans].writeln; }