#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> A(N, vector(N, false)); for (int i = 0; i < M; i++) { int u, v; cin >> u >> v; u--, v--; A[u][v] = true; A[v][u] = true; } for (int t = 0; t < N; t++) { bitset<15> bs_all; bs_all = ~bs_all; for (int i = 0; i < K; i++) { bitset<15> bsi; 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) bsi.set(__builtin_popcount(bit) - 1, 1); for (int v = 0; v < N; v++) { if (A[u][v] && (bit >> v & 1) == 0) { dp[bit ^ (1 << v)][v] = true; } } } } bs_all &= bsi; } if (bs_all.any()) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }