n,m,K=map(int,input().split()) x=list(map(int,input().split())) for i in range(K): x[i]-=1 e=[[] for i in range(n)] for i in range(m): u,v=map(int,input().split()) u-=1 v-=1 e[u]+=[v] e[v]+=[u] E=[] for s in range(n): q=[0]*(1<>j)&1: for k in e[j]: if (i>>k)&1==0: q[i|(1<>j)&1: E[s][j]|=1<<(i.bit_count()-1) for i in range(n): g=(1<0: print("Yes") exit() print("No")