from collections import deque,defaultdict N,M,K=map(int,input().split()) X=list(map(lambda x: int(x)-1,input().split())) G=[[]for _ in range(N)] for _ in range(M): u,v=map(int,input().split()) G[u-1].append(v-1) G[v-1].append(u-1) routes=[[] for _ in range(K)] for k in range(K): Q=deque([(X[k],)]) while Q: route=Q.popleft() for nxt in G[list(route)[-1]]: if nxt not in set(route): Q.append(route+(nxt,)) routes[k].append(route) cnt=[[0 for _ in range(N)] for _ in range(N)] for k in range(K): for route in routes[k]: for ii,n in enumerate(route): cnt[ii][n]+=1 for i in range(N): for n in range(N): if cnt[i][n]==K:exit(print("Yes")) print("No")