import java.util.*; import java.io.*; import java.math.*; public class jeroen { public static void main(String[] args) throws Exception { // Read input BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String[] ps = in.readLine().split(" "); int n = Integer.valueOf(ps[0]); int m = Integer.valueOf(ps[1]); List[] nbs = new List[n]; for(int i = 0; i < n; i++) nbs[i] = new ArrayList(); for(int i = 0; i < m; i++) { ps = in.readLine().split(" "); int a = Integer.valueOf(ps[0])-1; int b = Integer.valueOf(ps[1])-1; nbs[a].add(b); nbs[b].add(a); } // Count number of neighbours per node int numnb = nbs[0].size(); if((1 << numnb) != n) no(); for(int i = 0; i < n; i++) if(nbs[i].size() != numnb) no(); // Because of the symmetry, we can just start numbering at an arbitrary node int[] num = new int[n]; boolean[] used = new boolean[n]; boolean[] vis = new boolean[n]; Queue q = new LinkedList(); int start = 42 % n; // decided by an arbirary dice roll q.add(start); while(!q.isEmpty()) { int a = q.poll(); vis[a] = true; if(used[num[a]]) no(); used[num[a]] = true; int j = 0; for(int b : nbs[a]) { num[b] |= a == start ? (1 << j++) : num[a]; if(!vis[b]) { q.offer(b); vis[b] = true; } } } // If a number is not used, the graph is not connected for(int i = 0; i < n; i++) if(!used[i]) no(); // All checks succeeded System.out.println("yes"); } public static void no() { System.out.println("no"); System.exit(0); } }