#include <bits/stdc++.h>
using namespace std;
void read(long long &x) { scanf("%lld", &x); }
void read(long long &x, long long &y) { scanf("%lld%lld", &x, &y); }
void read(long long &x, long long &y, long long &z) {
  scanf("%lld%lld%lld", &x, &y, &z);
}
void print(long long x) { printf("%lld ", x); }
void println(long long x) { printf("%lld\n", x); }
const long long N = 200010;
long long n, x, y, a[N], d[N], w[N], p[N], pos[N];
vector<long long> v[N], li[N];
queue<long long> q;
int main() {
  cin >> n;
  for (long long i = 1; i < n; i++)
    read(x, y), v[x].push_back(y), v[y].push_back(x);
  for (long long i = 1; i <= n; i++) read(a[i]), pos[a[i]] = i;
  q.push(1);
  p[1] = 0;
  w[1] = 1;
  for (; !q.empty();) {
    x = q.front();
    q.pop();
    for (long long to : v[x]) {
      if (!w[to]) d[to] = d[x] + 1, w[to] = 1, q.push(to), p[to] = x;
    }
  }
  if (a[1] != 1) {
    cout << "No";
    return 0;
  }
  for (long long i = 2; i <= n; i++)
    if (d[a[i]] == d[a[i - 1]] || d[a[i]] == d[a[i - 1]] + 1)
      i = i;
    else {
      cout << "No";
      return 0;
    }
  for (long long i = 2; i < n; i++)
    if (d[a[i]] == d[a[i + 1]] && pos[p[a[i]]] > pos[p[a[i + 1]]]) {
      cout << "No";
      return 0;
    }
  cout << "Yes";
}
