#include <bits/stdc++.h>
int main() {
  int t;
  int a[1005], b[1005], c[1005];
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  int i;
  scanf("%d", &t);
  for (i = 2; i <= t; i++) {
    scanf("%d", &a[i]);
    b[a[i]]++;
  }
  for (i = 2; i <= t; i++) {
    if (b[i] == 0) {
      c[a[i]]++;
    }
  }
  for (i = 1; i <= t; i++) {
    if (c[i] != 0 && c[i] < 3) {
      printf("No\n");
      return 0;
    }
    if (b[i] != 0 && c[i] == 0) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
