#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n;
int a[N];
int par[N];
bool leaf[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x;
    scanf("%d", &x);
    x--;
    par[i] = x;
    leaf[x] = 0;
    leaf[i] = 1;
  }
  for (int i = 0; i < n; i++)
    if (leaf[i]) a[par[i]]++;
  for (int i = 0; i < n; i++) {
    if (!leaf[i] && a[i] < 3) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
