#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
template <class T>
inline T biton(T n, T pos) {
  return n | ((T)1 << pos);
}
template <class T>
inline T bitoff(T n, T pos) {
  return n & ~((T)1 << pos);
}
template <class T>
inline T ison(T n, T pos) {
  return (bool)(n & ((T)1 << pos));
}
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename T>
string NumberToString(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
inline int nxt() {
  int aaa;
  scanf("%d", &aaa);
  return aaa;
}
inline long long int lxt() {
  long long int aaa;
  scanf("%lld", &aaa);
  return aaa;
}
inline double dxt() {
  double aaa;
  scanf("%lf", &aaa);
  return aaa;
}
template <class T>
inline T bigmod(T p, T e, T m) {
  T ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % m;
    p = (p * p) % m;
  }
  return (T)ret;
}
int ar[1000010];
set<int> adj[1000010];
queue<int> q;
int main() {
  int n = nxt();
  for (int i = 0; i < n - 1; i++) {
    int a = nxt();
    int b = nxt();
    adj[a].insert(b);
    adj[b].insert(a);
  }
  for (int i = 0; i < n; i++) ar[i] = nxt();
  if (ar[0] != 1) {
    cout << "No" << endl;
    return 0;
  }
  if (n == 1) {
    cout << "Yes" << endl;
    return 0;
  }
  q.push(1);
  int i = 1;
  while (!q.empty()) {
    int top = q.front();
    q.pop();
    while (adj[top].size()) {
      int val = ar[i++];
      if (adj[top].find(val) != adj[top].end()) {
        q.push(val);
        adj[top].erase(adj[top].find(val));
        adj[val].erase(adj[val].find(top));
        if (i >= n) {
          cout << "Yes" << endl;
          return 0;
        }
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  assert(0);
  return 0;
}
