N,M,K=map(int, input().split()) X=list(map(int, input().split())) if len(set(X))==1: print('Yes') exit() D=[[] for i in range(N)] for i in range(M): u,v=map(int, input().split()) u-=1;v-=1 D[u].append(v);D[v].append(u) from collections import deque d=deque() ans=[(1<<(N+2))-1]*N for i in range(K): now=X[i]-1 d=deque() V=[0]*N V[now]+=1 d.append((now,1<