import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) #input = sys.stdin.readline #alist = list(map(int,input().split())) class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = self.find(x) y = self.find(y) if x == y: return if self.parents[x] > self.parents[y]: x, y = y, x self.parents[x] += self.parents[y] self.parents[y] = x def size(self, x): return -self.parents[self.find(x)] def same(self, x, y): return self.find(x) == self.find(y) def members(self, x): root = self.find(x) return [i for i in range(self.n) if self.find(i) == root] def roots(self): return [i for i, x in enumerate(self.parents) if x < 0] def group_count(self): return len(self.roots()) def all_group_members(self): group_members = collections.defaultdict(list) for member in range(self.n): group_members[self.find(member)].append(member) return group_members def __str__(self): return ''.join(f'{r}: {m}' for r, m in self.all_group_members().items()) #alist = [] #s = input() n,m,k = map(int,input().split()) x = list(map(lambda x:int(x)-1,input().split())) x = list(set(x)) edge = [[] for i in range(n)] for i in range(m): u,v = map(int,input().split()) u-=1 v-=1 edge[u].append(v) edge[v].append(u) ans = [[set() for i in range(n+1)] for j in range(n+1)] for y in x: dist = [[0 for i in range(n)] for j in range(1<> i) & 1 == 0: continue for j in edge[i]: if(s >> j) & 1 == 1: continue dist[s | (1 << j)][j] |= dist[s][i] if dist[s][i] == 1: ans[i][s.bit_count()].add(y) for i in range(n+1): for j in range(n+1): if len(ans[i][j]) == len(x) : exit(print('Yes')) print('No')