N, M = map(int, input().split())
G: list = [[] for _ in range(N)]
for _ in range(M):
    u, v = map(int, input().split())
    G[u - 1].append(v - 1)
    G[v - 1].append(u - 1)


s = -1
for i in range(N):
    if len(G[i]) == 1:
        s = i
        break
if s < 0:
    print("No")
    exit(0)

visited = {s}
stack = [s]
path = []
while stack:
    cr = stack.pop()
    path.append(cr)
    visited.add(cr)
    if len(G[cr]) > 2:
        print("No")
        exit(0)
    for nx in G[cr]:
        if nx not in visited:
            stack.append(nx)

if len(path) == N:
    print("Yes")
else:
    print("No")
