#include int main() { std::cin.tie(nullptr)->sync_with_stdio(false); int n, m, k; std::cin >> n >> m >> k; std::vector a(k); for (auto &x : a) std::cin >> x, --x; std::vector> g(n); for (int i = 0; i < m; ++i) { int u, v; std::cin >> u >> v, --u, --v; g[u].push_back(v); g[v].push_back(u); } std::vector dp(k, std::vector(1 << n, std::vector(n))); for (int i = 0; i < k; ++i) dp[i][1 << a[i]][a[i]] = 1; for (int i = 0; i < k; ++i) for (unsigned mask = 0; mask < (1 << n); ++mask) for (int j = 0; j < n; ++j) if (dp[i][mask][j]) for (auto &nj : g[j]) if (~mask >> nj & 1) dp[i][mask | 1 << nj][nj] = 1; std::vector turn(n + 1, std::vector(n)); for (int i = 0; i < k; ++i) for (unsigned mask = 0; mask < (1 << n); ++mask) for (int j = 0; j < n; ++j) if (dp[i][mask][j]) turn[std::popcount(mask)][j] |= 1 << i; int res = 0; for (int step = 0; step <= n; ++step) for (int i = 0; i <= n; ++i) res |= (turn[step][i] == (1 << k) - 1); std::cout << (res ? "Yes" : "No") << '\n'; return 0; }