#include int popcount(int n) { int res = 0; for (; n > 0; res += n % 2, n /= 2); return res; } int e[16][16]; int x[16]; int dp[100005][16]; int can[16][16][16]; int main() { int n, m, K; scanf("%d %d %d", &n, &m, &K); int i, j, k; for (i = 0; i < K; i++) { scanf("%d", &x[i]); x[i]--; } for (i = 0; i < n; i++) for (j = 0; j < n; j++) e[i][j] = 0; int u, v; for (i = 0; i < m; i++) { scanf("%d %d", &u, &v); u--; v--; e[u][v] = e[v][u] = 1; } for (i = 0; i < K; i++) for (j = 0; j < n; j++) for (k = 0; k < n; k++) can[i][j][k] = 0; for (i = 0; i < K; i++) { for (j = 0; j < (1 << n); j++) for (k = 0; k < n; k++) dp[j][k] = 0; dp[1 << x[i]][x[i]] = 1; for (j = 0; j < (1 << n); j++) { for (k = 0; k < n; k++) { if (dp[j][k] == 0) continue; can[i][k][popcount(j) - 1] = 1; for (v = 0; v < n; v++) if ((j & (1 << v)) == 0 && e[k][v] > 0) dp[j | (1 << v)][v] = 1; } } } for (u = 0; u < n; u++) { for (i = 0; i < n; i++) { k = 0; for (j = 0; j < K; j++) if (can[j][u][i] == 0) k++; if (k == 0) { printf("Yes\n"); return 0; } } } printf("No\n"); return 0; }