n,m,k=map(int,input().split()) x=list(map(int,input().split())) a=[[] for i in range(n)] for i in range(m): s,t=map(int,input().split()) a[s-1].append(t-1) a[t-1].append(s-1) y=[0 for i in range(n)] now={x[0]-1} used={x[0]-1} c=1 while now: new=set() for i in now: for j in a[i]: if j not in used: new.add(j) used.add(j) y[j]=c now=new c+=1 for i in x: if i-1 not in used: print('No') exit() if y[i-1]%2!=0: print('No') exit() print('Yes')