import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); int m = sc.nextInt(); int[] counts = new int[n]; UnionFindTree uft = new UnionFindTree(n); for (int i = 0; i < m; i++) { int x = sc.nextInt(); int y = sc.nextInt(); counts[x]++; counts[y]++; uft.unite(x, y); } int judge = 0; HashSet parents = new HashSet<>(); for (int i = 0; i < n; i++) { judge += counts[i] % 2; if (counts[i] > 0) { parents.add(uft.find(i)); } } if (judge <= 2 && parents.size() == 1) { System.out.println("YES"); } else { System.out.println("NO"); } } static class UnionFindTree { int[] parents; public UnionFindTree(int size) { parents = new int[size]; for (int i = 0; i < size; i++) { parents[i] = i; } } public int find(int x) { if (x == parents[x]) { return x; } else { return parents[x] = find(parents[x]); } } public boolean same(int x, int y) { return find(x) == find(y); } public void unite(int x, int y) { if (!same(x, y)) { parents[find(x)] = find(y); } } } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }