#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long power(long long a, long long b, long long p) {
  if (a == 0) return 0;
  long long res = 1;
  if (a >= p) a = a % p;
  while (b > 0) {
    if (b & 1) res = (res * a) % p;
    b >>= 1;
    a = (a * a) % p;
  }
  return res;
}
vector<long long> decToBinary(long long n) {
  vector<long long> v;
  for (long long i = 31; i >= 0; i--) {
    long long k = n >> i;
    if (k & 1)
      v.push_back(1);
    else
      v.push_back(0);
  }
  return v;
}
long long binarySearch(long long arr[], long long l, long long r, long long x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
long long maxResult(long long n, long long a, long long b, long long c) {
  long long maxVal = 0;
  for (long long i = 0; i <= n; i += a)
    for (long long j = 0; j <= n - i; j += b) {
      float z = (float)(n - (i + j)) / c;
      if (floor(z) == ceil(z)) {
        long long x = i / a;
        long long y = j / b;
        maxVal = max(maxVal, x + y + (long long)z);
      }
    }
  return maxVal;
}
bool binary_search_vector(const vector<long long>& sorted_vec, long long key) {
  size_t mid, left = 0;
  size_t right = sorted_vec.size();
  while (left < right) {
    mid = left + (right - left) / 2;
    if (key > sorted_vec[mid]) {
      left = mid + 1;
    } else if (key < sorted_vec[mid]) {
      right = mid;
    } else {
      return true;
    }
  }
  return false;
}
void SeiveOfEratosthenes(long long n, long long k) {
  bool prime[n + 1];
  vector<long long> v;
  memset(prime, true, sizeof(prime));
  for (long long i = 2; i * i <= n; i++) {
    if (prime[i]) {
      for (long long j = i * i; j <= n; j += i) {
        prime[j] = false;
      }
    }
  }
  for (long long i = 2; i <= n; i++) {
    if (prime[i]) {
      v.push_back(i);
    }
  }
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
vector<vector<long long>> g;
vector<bool> vis;
vector<long long> level;
vector<long long> par;
void bfs(long long node) {
  queue<long long> q;
  q.push(node);
  level[node] = 1;
  vis[node] = true;
  par[1] = 0;
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    for (auto i : g[x]) {
      if (!vis[i]) {
        level[i] = level[x] + 1;
        par[i] = x;
        vis[i] = true;
        q.push(i);
      }
    }
  }
}
void solve() {
  long long n;
  cin >> n;
  long long a[n + 1];
  g.resize(n + 1);
  for (long long i = 0; i < n - 1; i++) {
    long long x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vis.assign(n + 1, 0);
  level.assign(n + 1, 0);
  par.assign(n + 1, 0);
  bfs(1);
  map<long long, long long> occur;
  long long ans[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    occur[a[i]] = i;
    ans[i] = level[a[i]];
  }
  long long flag = 0;
  for (long long i = 2; i <= n; i++) {
    if (ans[i] < ans[i - 1]) {
      flag = 1;
      break;
    } else {
      if (occur[par[a[i]]] < occur[par[a[i - 1]]]) {
        flag = 1;
        break;
      }
    }
  }
  if (flag)
    cout << "No";
  else
    cout << "Yes";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
