#include #define rep(i,n)for(int i=0;i<(n);i++) using namespace std; int cnt[500]; class UnionFind { vectorpar, high; public: UnionFind(int n) { par = high = vector(n); for (int i = 0; i < n; i++)par[i] = i; } int find(int x) { if (par[x] == x)return x; return par[x] = find(par[x]); } void unite(int x, int y) { x = find(x); y = find(y); if (x == y)return; if (high[x] > high[y])par[y] = x; else { par[x] = y; if (high[x] == high[y])high[y]++; } } bool same(int x, int y) { return find(x) == find(y); } }; int main(){ int n,m;scanf("%d%d",&n,&m); UnionFind uf(n); rep(i,m){ int a,b;scanf("%d%d",&a,&b); cnt[a]++;cnt[b]++; uf.unite(a,b); } int c=0,d=0; rep(i,n){ if(cnt[i]%2)c++; else d++; } rep(i,n)rep(j,n){ if(!uf.same(i,j)){ puts("NO");return 0; } } if(c==0||c==2)puts("YES"); else puts("NO"); }