#include using namespace std; int main() { int N, M, K; cin >> N >> M >> K; bool ok = false; vector X(K); for (int &Y : X) cin >> Y; vector seen(N); vector> G(N); vector Park(200, vector(N, vector(K))); for (int i = 0; i < M; i++) { int u, v; cin >> u >> v; G.at(u - 1).push_back(v - 1); G.at(v - 1).push_back(u - 1); } auto DFS = [&](auto DFS, int turn, int fNo, int v) -> void { seen.at(v) = true; Park.at(turn).at(v).at(fNo) = true; for (int nv : G.at(v)) if (!seen.at(nv) && !Park.at(turn + 1).at(nv).at(fNo)) DFS(DFS, turn + 1, fNo, nv); seen.at(v) = false; }; for (int i = 0; i < K; i++) DFS(DFS, 0, i, X.at(i) - 1); for (int i = 0; i < 200; i++) { for (int j = 0; j < N; j++) { int Count = 0; for (int k = 0; k < K; k++) if (Park.at(i).at(j).at(k)) Count++; if (Count == K) ok = true; } } cout << (ok ? "Yes" : "No") << endl; }