import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### n,m,k = na() x = [x-1 for x in na()] G = [[] for i in range(n)] for _ in range(m): u,v = na() u -= 1 v -= 1 G[u].append(v) G[v].append(u) g = [[0 for j in range(n)] for i in range(n)] for i in range(n): dp = [[0] * n for _ in range(1<> to & 1:continue nbit = bit | (1 << to) dp[nbit][to] |= dp[bit][fr] << 1 # print(dp) for bit in range(1 << n): for j in range(n): g[i][j] |= dp[bit][j] # for i in range(n): # for j in range(n): # print(i, j, bin(g[i][j])) for v in range(n): y = (1 << n) - 1 for i in range(k): y &= g[x[i]][v] if y: Yes() break else: No()