#include #include #include using namespace std; int main() { int n, m, a, b; cin >> n >> m; vector> graph(n); while (cin >> a >> b) { a--; b--; graph[a].push_back(b); graph[b].push_back(a);} vector color(n, -1); for (int v = 0; v < n; v++) { if (color[v] != -1) continue; queue que; color[v] = 0; que.push(v); while (!que.empty()) { int qv = que.front(); que.pop(); for (auto nv : graph[qv]) { if (color[nv] != -1) { if (color[nv] == color[qv]) {cout << "No" << endl; return 0;} continue; } color[nv] = 1 - color[qv]; que.push(nv); } } } cout << "Yes" << endl; }