R=range J=lambda:map(int,input().split()) N,M=J() c=[0]*N for m in R(M): v,w=J() c[v]+=1 c[w]+=1 S=set(J()) T=set() for n in R(N): if(c[n]>1):T.add(n) print("YNeos"[M<5and(len(T)<3or S==T)::2])