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: class Graph:
      def __init__(self, V: int):
          self.__V = V
          self.__g = [[] for _ in range(V)]
          self.__used = [False] * V
  
      def add_edge(self, u: int, v: int, cap: int):
          self.__g[u].append((v, cap, len(self.__g[v])))
          self.__g[v].append((u, 0, len(self.__g[u]) - 1))
  
      def ford_fulkerson(self, s: int, t: int) -> int:
          flow = 0
          while True:
              self.__used = [False] * self.__V
              f = self.__dfs(s, t, float("inf"))
              if f == 0:
                  break
              flow += f
          return flow
  
      def __dfs(self, v: int, t: int, f: int) -> int:
          if v == t:
              return f
          self.__used[v] = True
  
          for i, (to, cap, rev) in enumerate(self.__g[v]):
              if (not self.__used[v]) and cap > 0:
                  d = self.__dfs(to, t, min(f, cap))
  
                  if d > 0:
                      self.__g[v][i] = (to, cap - d, rev)
                      self.__g[to][rev][1] += d
                      return d
          return 0
  
  
  def three_circuits(N: int, M: int, edges: list) -> bool:
      d = [0] * N
  
      for u, v in edges:
          d[u - 1] += 1
          d[v - 1] += 1
  
      if any(v & 1 == 1 for v in d):
          # euler 閉路でないなら NG
          return False
      if any(v >= 6 for v in d):
          # 次数が 6 以上のものがあれば OK
          return True
  
      c4 = d.count(4)
      if c4 >= 3:
          # 次数が 4 のものが 3 つ以上存在すれば OK
          return True
      if c4 < 2:
          # 次数が 4 のものが 1 つ以下なら NG
          return False
  
      # 次数が 4 のものが 2 つならその二つの頂点間にパスが二つ
      # の時のみ OK
      graph = Graph(N)
      for u, v in edges:
          graph.add_edge(u, v, 1)
  
      u = d.index(4)
      v = d.index(4, start=u + 1)
  
      return graph.ford_fulkerson(u, v) == 2
  
  
  if __name__ == "__main__":
      M = 0
      N, M = map(int, input().split())
      edges = [tuple(map(int, input().split())) for _ in range(M)]
      yes = three_circuits(N, M, edges)
      print("Yes" if yes else "No")
  
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"}]