#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> adjList;
int N;
bool isLeaf(int node) {
  if (node == 0) return 0;
  if (adjList[node].size() == 0) {
    return true;
  } else {
    return false;
  }
}
int main() {
  scanf("%d", &N);
  adjList.assign(N, vector<int>());
  for (int i = 1; i < N; i++) {
    int par;
    scanf("%d", &par);
    par--;
    adjList[par].push_back(i);
  }
  bool good = true;
  for (int i = 0; i < N; i++) {
    if (!isLeaf(i)) {
      int cnt = 0;
      for (auto adj : adjList[i]) {
        if (isLeaf(adj)) {
          cnt++;
        }
      }
      if (cnt < 3) {
        good = false;
        break;
      }
    }
  }
  if (good) {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}
