#include <bits/stdc++.h>
int main() {
  int n;
  int nodes[100000] = {0};
  int leafs[100000] = {0};
  int isleaf[100000] = {0};
  int parent[100000];
  parent[1] = 0;
  scanf("%d", &n);
  int i, j;
  for (i = 1; i < n; ++i) {
    scanf("%d", &j);
    parent[i + 1] = j;
    nodes[j]++;
  }
  for (i = 1; i <= n; ++i) {
    if (nodes[i] == 0) {
      isleaf[i] = 1;
    }
  }
  int flag = 0;
  for (i = 1; i <= n; ++i) {
    if (isleaf[i] == 1) {
      leafs[parent[i]]++;
    }
  }
  for (i = 1; i <= n; ++i) {
    if (isleaf[i] == 0) {
      if (leafs[i] < 3) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }
  return 0;
}
