class dsu(): n=1 parent_or_size=[-1 for i in range(n)] def __init__(self,N): self.n=N self.parent_or_size=[-1 for i in range(N)] def merge(self,a,b): assert 0<=a0: result2.append(result[i]) return result2 import sys input = lambda: sys.stdin.readline().rstrip() nm = list(map(str,input().split())) n = int(nm[0]) m = int(nm[1]) sg = list(map(str,input().split())) s = int(sg[0]) g = int(sg[1]) uv = [] for i in range(m): uv.append(list(map(int,input().split()))[:2]) u = int(input()) I = list(map(int,input().split()))[:u] U = dsu(n + 1) for u, v in uv: if (u in I) or (v in I): continue else: U.merge(u, v) print('Yes' if U.same(s, g) else 'No')