#include <bits/stdc++.h>
using namespace std;
int n;
struct tree {
  int ch;
  int lv;
  int pr;
} b[1005];
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    b[x].ch++;
    b[i].pr = x;
  }
  for (int i = 1; i <= n; i++)
    if (b[i].ch == 0) b[b[i].pr].lv++;
  for (int i = 1; i <= n; i++) {
    if (b[i].ch != 0 && b[i].lv < 3) {
      printf("No");
      return 0;
    }
  }
  printf("Yes");
  return 0;
}
