#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
vector<int> vertex[200005], Answer;
int a[N], Level[N];
int n;
queue<int> q;
bool Free[N];
bool SortFunc(int l, int m) { return Level[l] < Level[m]; }
void Init() {
  scanf("%d", &n);
  memset(Free, true, sizeof(Free));
  int x, y;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    vertex[x].push_back(y);
    vertex[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    Level[a[i]] = i;
  }
  for (int i = 1; i <= n; i++)
    sort(vertex[i].begin(), vertex[i].end(), SortFunc);
}
void BFS() {
  q.push(1);
  Free[1] = false;
  Answer.push_back(1);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto k : vertex[u])
      if (Free[k]) {
        q.push(k);
        Answer.push_back(k);
        Free[k] = false;
      }
  }
  int CountLoop = 1;
  for (auto k : Answer) {
    if (k == a[CountLoop])
      CountLoop++;
    else {
      cout << "No";
      return;
    }
  }
  cout << "Yes";
}
int main() {
  Init();
  BFS();
}
