import sys sys.setrecursionlimit(10 ** 8) N,M = map(int,input().split()) C = 2 * N parent = [-1] * C def find(i): if parent[i] < 0:return i parent[i] = find(parent[i]) return parent[i] def unite(i,j): I = find(i) J = find(j) if I == J:return False if parent[I] < parent[J]: I,J = J,I parent[J] += parent[I] parent[I] = J return True def isSame(i,j): return find(i) == find(j) for _ in range(M): a,b = map(int,input().split()) a -= 1 b -= 1 unite(a,b + N) unite(a + N,b) for i in range(N): if find(i) != find(i + N): print('No') exit() print('Yes')