import sys sys.setrecursionlimit(100000) n,m,k=map(int,input().split()) x=set(map(lambda a:int(a)-1,input().split())) con=[[] for _ in range(n)] for i in range(m): u,v=map(int,input().split()) con[u-1].append(v-1) con[v-1].append(u-1) possible=[set() for _ in range(n)] visited=set() def dfs(now): #if now in possible[len(visited)]:return possible[len(visited)].add(now) visited.add(now) for nex in con[now]: if nex not in visited: dfs(nex) visited.remove(now) for i in range(n): dfs(i) for j in possible: if x<=j: print("Yes") exit() possible=[set() for _ in range(n)] print("No")