#include #include using namespace std; using LL = long long; using P = pair; using Graph = vector>; const int INF = 1 << 29; const long long LINF = 1LL << 60; #define all(x) (x).begin(), (x).end() #define rep(i,n) for(int i = 0; i < (n); ++i) templatevoid chmin(T&a, T b){if(a > b) a = b;} templatevoid chmax(T&a, T b){if(a < b) a = b;} int main(){ int N, M; cin >> N >> M; vector A(N, 0); for(int i = 0; i < N; ++i) cin >> A[i]; Graph G(N); for(int i = 0; i < M; ++i){ int u, v; cin >> u >> v; --u; --v; G[u].push_back(v); G[v].push_back(u); } int K; cin >> K; vector state_off(N, true); for(int i = 0; i < K; ++i){ int B; cin >> B; --B; state_off[B] = false; } vector ans_off; for(int i = 0; i < N; ++i){ if(state_off[i]==false){ state_off[i] = true; ans_off.push_back(i); for(auto v : G[i]){ if(A[i]