#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, M, K; cin >> N >> M >> K; vector X(K); for (int i = 0; i < K; i++) { cin >> X[i]; X[i]--; } vector> 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); } vector> bs(K, vector(N, 0)); for (int i = 0; i < K; i++) { vector> dp(1 << N, vector(N, false)); dp[1 << X[i]][X[i]] = true; for (int bit = 0; bit < 1 << N; bit++) { for (int u = 0; u < N; u++) { if (!dp[bit][u]) continue; bs[i][u] |= 1LL << __builtin_popcount(bit); for (int v : G[u]) { if ((bit >> v & 1) == 0) { dp[bit ^ (1 << v)][v] = true; } } } } } for (int t = 0; t < N; t++) { long long bs_all = 0; bs_all = ~bs_all; for (int i = 0; i < K; i++) { bs_all &= bs[i][t]; } if (__builtin_popcountll(bs_all)) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }