N, M, K = map(int, input().split()) X = list(set((map(int, input().split())))) NX = len(X) UV = [list(map(int, input().split())) for _ in range(M)] E = [[] for _ in range(N)] for u, v in UV: u -= 1 v -= 1 E[u].append(v) E[v].append(u) M = [[0] * N for _ in range(NX)] def dfs(x, d): global id M[id][x] |= (d % 2 + 1) for y in E[x]: if nv[y]: nv[y] = False dfs(y, d + 1) nv[y] = True for i in range(NX): x = X[i] - 1 id = i nv = [True] * N dfs(x, 0) for i in range(N): tmp = 3 for j in range(NX): tmp &= M[j][i] if tmp != 0: print("Yes") exit() print("No")