#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } int main() { fast_io(); 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); } int dp[n][1 << n] = {}; for (int i = 0; i < n; i++) { dp[i][1 << i] = 1 << i; } for (int i = 0; i < n; i++) { for (int j = 0; j < (1 << n); j++) { for (int cur = 0; cur < n; cur++) { if (dp[i][j] & (1 << cur)) { for (int nxt : g[cur]) { if (!(j & (1 << nxt))) { dp[i][j | (1 << nxt)] |= (1 << nxt); } } } } } } vector ok(n, (1 << n) - 1); for (int i = 0; i < k; i++) { vector ok_i(n, 0); for (int j = 1; j < (1 << n); j++) { int cnt = __builtin_popcount(j) - 1; ok_i[cnt] |= dp[x[i]][j]; } for (int j = 0; j < n; j++) { ok[j] &= ok_i[j]; } } for (int i = 0; i < n; i++) { if (ok[i]) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }