import java.util.*; public class Main { static int[] par; static int[] rank; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); par = new int[n]; rank = new int[n]; for(int i = 0; i < n; i++) { par[i] = i; rank[i] = 0; } int kiten = 0; int[] e = new int[n]; for(int i = 0; i < m; i++) { int a = sc.nextInt(); int b = sc.nextInt(); e[a]++; e[b]++; unite(a, b); } for(int i = 0; i < n; i++) { if(e[i] % 2 == 1) kiten++; } int count = 0; for(int i = 0; i < n; i++) { for(int j = i + 1; j < n; j++) { if((e[i] > 0) && (e[j] > 0)) { if(!same(i, j)) count++; } } } String ans = "NO"; if((count == 0) && ((kiten == 0) || (kiten == 2))) ans = "YES"; System.out.println(ans); } public static int find(int x) { if(par[x] == x) { return x; } else { return par[x] = find(par[x]); } } public static void unite(int x, int y) { x = find(x); y = find(y); if(rank[x] < rank[y]) { par[x] = y; } else { par[y] = x; if(rank[x] == rank[y]) rank[x]++; } } public static boolean same(int x, int y) { return find(x) == find(y); } }