def dfs(v, d, p): if (v, d, p) in used: return used.add((v, d, p)) dist[v].add(d) for nv in G[v]: if seen[nv]==1: continue seen[nv] = 1 dfs(nv, d+1, v) seen[nv] = 0 #print(dist) import sys import pypyjit pypyjit.set_param('max_unroll_recursion=-1') input = sys.stdin.readline N, M, K = map(int, input().split()) X = list(map(int, input().split())) G = [[] for _ in range(N)] for _ in range(M): u, v = map(int, input().split()) u-=1 v-=1 G[u].append(v) G[v].append(u) for i in range(K): X[i]-=1 for i in range(N): dist = [set() for _ in range(N)] seen = [0 for _ in range(N)] seen[i] = 1 used = set() dfs(i, 0, -1) tmp = dist[X[0]] for j in range(1, K): tmp &= dist[X[j]] if len(tmp)>0: print("Yes") exit() print("No")