import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt(); int[] x = new int[k]; for (int i = 0; i < k; i++) { x[i] = sc.nextInt() - 1; } boolean[][] g = new boolean[n][n]; for (int i = 0; i < m; i++) { int u = sc.nextInt() - 1; int v = sc.nextInt() - 1; g[u][v] = true; g[v][u] = true; } sc.close(); boolean all = true; for (int i = 1; i < k; i++) { if (x[i] != x[0]) { all = false; break; } } if (all) { System.out.println("Yes"); return; } Set set = new HashSet<>(); for (int i = 0; i < k; i++) { set.add(x[i]); } int n2 = 1 << n; boolean[][][] b = new boolean[n][n][n2]; for (int i = 0; i < n; i++) { b[i][i][1 << i] = true; } for (int t = 0; t < n - 1; t++) { boolean[][][] b2 = new boolean[n][n][n2]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { for (int a = 0; a < n2; a++) { if ((a >> j & 1) == 1 && b[i][j][a]) { for (int j2 = 0; j2 < n; j2++) { if (g[j][j2] && (a >> j2 & 1) == 0) { int a2 = a | (1 << j2); b2[i][j2][a2] = true; } } } } } } for (int j = 0; j < n; j++) { boolean flg = true; for (int i : set) { boolean flg2 = false; for (int a = 0; a < n2; a++) { if (b2[i][j][a]) { flg2 = true; break; } } if (!flg2) { flg = false; break; } } if (flg) { System.out.println("Yes"); return; } } b = b2; } System.out.println("No"); } }