output_description: If three circuits can be formed using each of the edges exactly once, print
  `Yes`; if they cannot, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      a_1 b_1
      :
      a_M b_M
attempt: # AGC032C
  
  import sys
  
  input = lambda: sys.stdin.readline().rstrip()
  sys.setrecursionlimit(max(1000, 10**9))
  
  
  def hoge():
      from collections import defaultdict
  
      n, m = map(int, input().split())
  
      ns = defaultdict(set)
      used = {}
      for _ in range(m):
          u, v = map(int, input().split())
          ns[u - 1].add(v - 1)
          ns[v - 1].add(u - 1)
          used[u - 1, v - 1] = False
          used[v - 1, u - 1] = False
  
      seen = [False] * n
      prev = [None] * n
      cs = []
      count = 0
      done = True
      if not all(len(item) % 2 == 0 and len(item) > 0 for item in ns.values()):
          print("No")
          return
  
      for start in range(n):
          if seen[start]:
              continue
          q = [start]
          current_seen = [False] * n
          update = False
          while q:
              #         print(q)
              u = q.pop()
              current_seen[u] = True
              for v in ns[u]:
                  if used[u, v] or prev[u] == v:
                      continue
                  prev[v] = u
                  if current_seen[v]:
                      # サイクル検出
                      count += 1
                      c = set()
                      tmp = v
                      while tmp not in c:
                          c.add(tmp)
                          used[tmp, prev[tmp]] = used[prev[tmp], tmp] = True
                          tmp = prev[tmp]
                      cs.append(c)
                      for u in c:
                          seen[u] = True
                      update = True
                      break
                  q.append(v)
              if update:
                  break
          if not update:
              print("No")
              done = False
              break
  
      def sub(cs):
          if len(cs) == 1:
              return "No"
          elif len(cs) == 2:
              if len(set(cs[0] & cs[1])) >= 3:
                  return "Yes"
              else:
                  return "No"
          else:
              return "Yes"
  
      #     u2s = defaultdict(set)
      #     nns = defaultdict(set) # i番目のサイクルと重なるサイクル
      #     for i,s in enumerate(cs):
      #         for u in s:
      #             nns[i] |= u2s[u]
      #             u2s[u].add(i)
      #     for i,s in nns.items():
      #         for j in s:
      #             nns[j].add(i)
      #     count = 0
      # #     print(u2s)
      # #     print(nns)
      #     seen = [False] * len(cs)
      #     for start in range(len(cs)):
      #         if seen[start]:
      #             continue
      #         q = [start]
      #         seen[start] = True
      #         while q:
      #             u = q.pop()
      #             for v in nns[u]:
      #                 if not seen[v]:
      #                     q.append(v)
      #                     seen[v] = True
      #         count += 1
      #     if count<=3:
      #         return "Yes"
      #     else:
      #         return "No"
      if done:
          print(sub(cs))
      #     print("Yes")
  
  
  hoge()
  
problem_description: Statement
  
  You are given a simple connected undirected graph consisting of N vertices and
  M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M.
  
  Edge i connects Vertex a_i and b_i bidirectionally.
  
  Determine if three circuits (see Notes) can be formed using each of the edges
  exactly once.
samples: [{"input": "7 9\n    1 2\n    1 3\n    2 3\n    1 4\n    1 5\n    4 5\n    1 6\n    1 7\n    6 7", "output": "Yes\n    \n\n  * Three circuits can be formed using each of the edges exactly once, as follows: \n\n![b8c8e2245d45a31cf39749b0a49fc2bd.png](https://img.atcoder.jp/agc031/b8c8e2245d45a31cf39749b0a49fc2bd.png)\n\n* * *"}, {"input": "3 3\n    1 2\n    2 3\n    3 1", "output": "No\n    \n\n  * Three circuits are needed.\n\n* * *"}, {"input": "18 27\n    17 7\n    12 15\n    18 17\n    13 18\n    13 6\n    5 7\n    7 1\n    14 5\n    15 11\n    7 6\n    1 9\n    5 4\n    18 16\n    4 6\n    7 2\n    7 11\n    6 3\n    12 14\n    5 2\n    10 5\n    7 8\n    10 15\n    3 15\n    9 8\n    7 15\n    5 16\n    18 15", "output": "Yes"}]