import sys input = sys.stdin.readline N,M=map(int,input().split()) E=[[] for i in range(N+1)] E2=[[] for i in range(N+1)] for i in range(M): S=input().split() x=int(S[0]) y=int(S[-1]) if len(S[1])==4: E[x].append(y) E[y].append(x) else: E2[x].append(y) E2[y].append(x) # UnionFind Group = [i for i in range(N+1)] # グループ分け Nodes = [1]*(N+1) # 各グループのノードの数 def find(x): while Group[x] != x: x=Group[x] return x def Union(x,y): if find(x) != find(y): if Nodes[find(x)] < Nodes[find(y)]: Nodes[find(y)] += Nodes[find(x)] Nodes[find(x)] = 0 Group[find(x)] = find(y) else: Nodes[find(x)] += Nodes[find(y)] Nodes[find(y)] = 0 Group[find(y)] = find(x) for i in range(N+1): for to in E[i]: Union(i,to) E3=[[] for i in range(N+1)] for i in range(N+1): for to in E2[i]: if find(i)==find(to): print("No") exit() else: E3[find(i)].append(find(to)) E3[find(to)].append(find(i)) ANS=[] USE=[-1]*(N+1) for i in range(N+1): if find(i)!=i: continue if USE[i]!=-1: continue Q=[i] USE[i]=0 zero=Nodes[i] one=0 Z=[i] O=[] while Q: x=Q.pop() for to in E3[i]: if USE[to]==-1: USE[to]=USE[i]^1 if USE[to]==0: zero+=Nodes[to] Z.append(to) else: one+=Nodes[to] O.append(to) Q.append(to) else: if USE[to]==USE[i]^1: pass else: print("No") exit() if zero>=one: for z in Z: ANS.append(z) else: for o in O: ANS.append(o) SET=set(ANS) LANS=[] for i in range(1,N+1): if find(i) in SET: LANS.append(i) print("Yes") print(len(LANS)) print(*LANS)