#include using namespace std; struct UnionFind{ vector data; UnionFind(int size) : data(size, -1){} void unite(int x, int y){ x = root(x); y = root(y); if (x != y){ if (data[y] < data[x]) swap(x, y); data[x] += data[y]; data[y] = x; } } int root(int x) {return data[x] < 0 ? x : data[x] = root(data[x]);} int size(int x) {return -data[root(x)];} }; bool is_connected(UnionFind & uf){ int root = -1; for (int i = 0; i < uf.data.size(); ++i){ int r = uf.root(i); if (r == i) continue; if (root == -1){ root = r; }else if (root != r){ return false; } } return true; } bool has_one_stroke_path(const vector & degree){ int count_1 = 0; for (auto & d : degree){ if (d & 1) ++count_1; } if (count_1 == 0 or count_1 == 2){ return true; }else{ return false; } } int main() { cin.tie(0); ios::sync_with_stdio(false); int N, M; cin >> N >> M; vector degree(N, 0); UnionFind uf(N); for (int i = 0; i < M; ++i){ int a, b; cin >> a >> b; ++degree[a]; ++degree[b]; uf.unite(a, b); } if (is_connected(uf) and has_one_stroke_path(degree)){ cout << "YES" << endl; }else{ cout << "NO" << endl; } return 0; }