import pypyjit pypyjit.set_param('max_unroll_recursion=-1') import sys sys.setrecursionlimit(10**7) # UnionFind class UnionFind: def __init__(self,n): self.n=n self.parent_size=[-1]*n def leader(self,a): if self.parent_size[a]<0: return a self.parent_size[a]=self.leader(self.parent_size[a]) return self.parent_size[a] def merge(self,a,b): x,y=self.leader(a),self.leader(b) if x == y: return if abs(self.parent_size[x])= 2: into[to] -= 1 l = uf.groups() for lis in l: tmp = [] for now in lis: if into[now] == 1: tmp.append(now) for i in tmp: dfs(i) if (ans-1)%2 == 0: print("Yes") else: print("No")