#include <bits/stdc++.h>
using namespace std;
struct node {
  bool isLeaf;
  int no_of_leaf_child;
};
int main() {
  int n;
  scanf("%d", &n);
  node *arr = new node[n + 1];
  int *parent = new int[n + 1];
  for (int i = 1; i <= n; i++) {
    arr[i].isLeaf = true;
    arr[i].no_of_leaf_child = 0;
  }
  for (int i = 2; i <= n; i++) {
    scanf("%d", &parent[i]);
    arr[parent[i]].isLeaf = false;
  }
  for (int i = 2; i <= n; i++) {
    if (arr[i].isLeaf == true) {
      arr[parent[i]].no_of_leaf_child++;
    }
  }
  int i;
  for (i = 1; i <= n; i++) {
    if (arr[i].isLeaf == false && arr[i].no_of_leaf_child < 3) break;
  }
  if (i <= n) {
    printf("No");
  } else {
    printf("Yes");
  }
  return 0;
}
