#include int main() { std::cin.tie(nullptr)->sync_with_stdio(false); int n, m, k; std::cin >> n >> m >> k; assert(n <= 10); 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); } constexpr int N = 15; int d[N][N]{}; for (int i = 0; i < k; ++i) { std::vector st(n); auto dfs = [&](auto &dfs, int u, int step)->void { st[u] = 1; d[step][u] |= 1 << i; for (auto &v : g[u]) if (!st[v]) dfs(dfs, v, step + 1); st[u] = 0; }; dfs(dfs, a[i], 0); } int res = 0; for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) res|= (d[i][j] == (1 << k) - 1); std::cout << (res ? "Yes" : "No") << '\n'; return 0; }