// Arup Guha
// 9/1/2026
// Solution to 2026 UCF Locals Problem: Scylla and Charybdis and Many More!

import java.util.*;
import java.io.*;

public class seamonsters {

	public static int numNodes;
	public static ArrayList<Integer>[] g;
	public static boolean[] isExit;
	
	public static void main(String[] args) throws Exception {
		
		// Get # nodes, exits.
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		numNodes = Integer.parseInt(tok.nextToken());
		int numExits = Integer.parseInt(tok.nextToken());
		
		// Mark exits.
		isExit = new boolean[numNodes];
		tok = new StringTokenizer(stdin.readLine());
		for (int i=0; i<numExits; i++) {
			int exit = Integer.parseInt(tok.nextToken()) - 1;
			isExit[exit] = true;
		}
		
		// Make empty graph.
		g = new ArrayList[numNodes];
		for (int i=0; i<numNodes; i++)
			g[i] = new ArrayList<Integer>();
			
		// Read in graph.
		for (int i=0; i<numNodes-1; i++) {
			tok = new StringTokenizer(stdin.readLine());
			int u = Integer.parseInt(tok.nextToken()) - 1;
			int v = Integer.parseInt(tok.nextToken()) - 1;
			g[u].add(v);
			g[v].add(u);
		}
		
		// Go!
		boolean res = go(0, -1);
		
		// Ta da!
		if (res)
			System.out.println("YES");
		else
			System.out.println("NO");
	}

	// Solve for node u with parent par.
	public static boolean go(int u, int par) {
	
		// We're out!
		if (isExit[u]) return true;
		
		// Try to go to each child node. We need 2 to be winners to make it.
		int good = 0;
		for (Integer x: g[u]) {
		
			// Not a child.
			if (x.equals(par)) continue;
			
			boolean tmp = go(x, u);
			if (tmp) good++;
		}
		
		// This is the criteria for me to be able to make it.
		return good > 1;
	}
}