#include #include using namespace std; using namespace atcoder; int main(){ int N, M, L, s, t; cin >> N >> M >> s >> t; s--, t--; vector> E(M); for (auto& [u, v] : E) cin >> u >> v, u--, v--; cin >> L; vector I(L); for (int& i : I) cin >> i, i--; sort(I.begin(), I.end()); dsu uf(N); for (auto [u, v] : E){ if (binary_search(I.begin(), I.end(), u)) continue; if (binary_search(I.begin(), I.end(), v)) continue; uf.merge(u, v); } if (uf.same(s, t)) cout << "Yes" << endl; else cout << "No" << endl; }