#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 1000000000000000001

int main(){
	
	int n,m;
	cin>>n>>m;
	dsu D(n*2);
	rep(i,m){
		int a,b;
		cin>>a>>b;
		a--,b--;
		D.merge(a,b+n);
		D.merge(b,a+n);
	}
	
	rep(i,n){
		if(!D.same(i,i+n)){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	
	return 0;
}