#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); } for (int t = 0; t < N; t++) { long long bit_all = 0; bit_all = ~bit_all; for (int i = 0; i < K; i++) { long long bit_i = 0; 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; if (u == t) bit_i |= 1LL << __builtin_popcount(bit); for (int v : G[u]) { if ((bit >> v & 1) == 0) { dp[bit ^ (1 << v)][v] = true; } } } } bit_all &= bit_i; } if (__builtin_popcountll(bit_all)) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }