#define rep(i, n) for (int i = 0; i < (int)(n); i++) #define ALL(v) v.begin(), v.end() typedef long long ll; #include using namespace std; using Graph=vector>; vector color; bool dfs(const Graph &G,int v,int cur=0){ color[v]=cur; for(auto next_v:G[v]){ if(color[next_v]!=-1){ if(color[next_v]==cur) return false; continue; } if(!dfs(G,next_v,1-cur)) return false; } return true; } int main(){ int n,m; cin>>n>>m; Graph G(n); rep(i,m){ int a,b; cin>>a>>b; a--,b--; G[a].push_back(b); G[b].push_back(a); } color.assign(n,-1); bool b=true; rep(v,n){ if(color[v]!=-1) continue; if(!dfs(G,v)) b=false; } if(b) cout<<"Yes"<