void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int n, m; rd(n, m);
  auto deg=new int[](n);
  auto g=new int[][](n, 0);
  foreach(_; 0..m){
    int a, b; rd(a, b);
    g[a]~=b; g[b]~=a;
    deg[a]++; deg[b]++;
  }

  auto vis=new bool[](n);
  void f(int i){
    vis[i]=true;
    foreach(j; g[i]){
      if(!vis[j]) f(j);
    }
  }

  int cnt=0;
  foreach(i; 0..n)if(!vis[i] && g[i].length>0){
    f(i); cnt++;
  }
  if(cnt>1){writeln("NO"); return;}
  auto ev=reduce!((res, e)=>res+(e%2==0))(0, deg);
  auto od=reduce!((res, e)=>res+(e&1))(0, deg);
  if(ev==n || od==2) writeln("YES");
  else writeln("NO");
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}