N, M, K = map(int, input().split()) X = list(map(int, input().split())) G = [[] for i in range(N)] for i in range(M): u, v = map(int, input().split()) u, v = u - 1, v - 1 G[u].append(v) G[v].append(u) N2 = 1 << N inf = 10 ** 18 ans = [[set() for _ in range(N)] for _ in range(K)] for xx, start in enumerate(X): start -= 1 dp = [[inf] * N for _ in range(N2)] dp[1 << start][start] = 0 ans[xx][start].add(0) for s in range(N2): for i in range(N): if (s >> i) & 1 == 0: continue if dp[s][i] == inf: continue cnt = 0 for j in range(N): if (s >> j) & 1: cnt += 1 for j in G[i]: if (s >> j) & 1: continue ns = s | 1 << j dp[ns][j] = min(dp[ns][j], dp[s][i] + 1) ans[xx][j].add(cnt) for v in range(N): for j in range(N): flag = 1 for i in range(K): if v not in ans[i][j]: flag = 0 break if flag: print("Yes") exit() print("No")