n, m, k = map(int, input().split()) X = list(map(int, input().split())) X = list(set(X)) edges = [[] for _ in range(n)] for _ in range(m): u, v = map(int, input().split()) u -= 1 v -= 1 edges[u].append(v) edges[v].append(u) if len(set(X)) == 1: print("Yes") exit() ans = [(1 << k) - 1] * n for x in X: x -= 1 dp = [[False] * n for _ in range(1 << n)] dp[1 << x][x] = True ok = [0] * n for bit in range(1 << n): pc = bin(bit).count("1") for i in range(n): if not dp[bit][i]: continue ok[pc - 1] |= 1 << i for j in edges[i]: if not (bit >> j & 1): dp[bit | 1 << j][j] = True for i in range(n): ans[i] &= ok[i] if any(a > 0 for a in ans): print("Yes") else: print("No")