N,M,K=map(int,input().split()) A=list(map(int,input().split())) p=[0]*N G=[[] for i in range(N)] v=[[0]*N for i in range(N+1)] for i in range(K): A[i]-=1 for i in range(K): p[A[i]]+=1 for i in range(M): a,b=map(int,input().split()) G[a-1].append(b-1) G[b-1].append(a-1) for x in range(N): if not x in A: continue h=[[0]*N for i in range(N+1)] dp=[0]*(N*(2**N)) dp[(2**x)*N+x]=1 for bit in range(1,2**N): count=0 for k in range(N): if (bit>>k)&1: count+=1 for i in range(N): if dp[bit*N+i]==0: continue for j in G[i]: if (bit>>j)&1: continue bit2=bit+2**j h[count+1][j]=1 dp[bit2*N+j]=1 for i in range(N+1): for j in range(N): v[i][j]+=p[x]*h[i][j] for count in range(1,N+1): for j in range(N): if v[count][j]==K: print('Yes') exit() print('No')