import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
public class Main {
static int n, m;
static int N = 200010;
static int[] head = new int[N];
static int[] e = new int[N];
static int[] nei = new int[N];
static int[] color = new int[N];
static int idx = 0;
public static void build(int x, int y){
e[idx] = y;
nei[idx] = head[x];
head[x] = idx ++;
}
public static boolean dfs(int node, int c){
color[node] = c;
for(int i = head[node]; i != -1; i = nei[i]){
int node_id = e[i];
if(color[node_id] == 0){
if(!dfs(node_id, 3 - c))
return false;
}
else if(color[node_id] == c)
return false;
}
return true;
}
public static void main(String[] args) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
String[] l1 = input.readLine().split(" ");
n = Integer.parseInt(l1[0]);
m = Integer.parseInt(l1[1]);
Arrays.fill(head, -1);
while(m -- > 0){
String[] l = input.readLine().split(" ");
int x = Integer.parseInt(l[0]);
int y = Integer.parseInt(l[1]);
build(x, y); build(y, x);
}
for(int i = 1; i <= n; i ++){
if(color[i] == 0){
if(!dfs(i, 1)){
System.out.println("No");
return;
}
}
}
System.out.println("Yes");
input.close();
return;
}
}