#include #include #define rep(i,n) for(int i=0;i vi; typedef vector vl; typedef vector> vvi; typedef vector> vvl; typedef long double ld; typedef pair P; ostream& operator<<(ostream& os, const modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const static_modint& a) {os << a.val(); return os;} template ostream& operator<<(ostream& os, const dynamic_modint& a) {os << a.val(); return os;} template istream& operator>>(istream& is, vector& v){int n = v.size(); assert(n > 0); rep(i, n) is >> v[i]; return is;} template ostream& operator<<(ostream& os, const pair& p){os << p.first << ' ' << p.second; return os;} template ostream& operator<<(ostream& os, const vector& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : " "); return os;} template ostream& operator<<(ostream& os, const vector>& v){int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "\n" : ""); return os;} template void chmin(T& a, T b){a = min(a, b);} template void chmax(T& a, T b){a = max(a, b);} // Weighted Union Find // O(alpha(N)) // thanks for "https://ei1333.github.io/luzhiled/snippets/structure/union-find.html" template struct WeightedUnionFind { vector data; vector ws; WeightedUnionFind() {} WeightedUnionFind(int sz) : data(sz, -1), ws(sz) {} int root(int k){ if(data[k] < 0) return k; auto par = root(data[k]); ws[k] += ws[data[k]]; return data[k] = par; } T weight(int t) { root(t); return ws[t]; } bool same(int x, int y){ x = root(x), y = root(y); if(x == y) return true; else return false; } bool unite(int x, int y, T w) { w += weight(x); w -= weight(y); x = root(x), y = root(y); if(x == y) return false; if(data[x] > data[y]) { swap(x, y); w *= -1; } data[x] += data[y]; data[y] = x; ws[y] = w; return true; } T diff(int x, int y) { return weight(y) - weight(x); } }; int main(){ int n, m; cin >> n >> m; WeightedUnionFind uf(n); rep(i, m){ int u, v; cin >> u >> v; u--; v--; if(uf.same(u, v)){ int w = uf.diff(u, v); if(abs(w) % 2 == 0){ cout << "No\n"; return 0; } }else{ uf.unite(u, v, 1); } } cout << "Yes\n"; return 0; }