#include <bits/stdc++.h>
using namespace std;
int isnonleaf[1005] = {};
int nleafchild[1005] = {};
int p[1005] = {};
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) scanf("%d", &p[i]);
  for (int i = 2; i <= n; i++) isnonleaf[p[i]] = 1;
  for (int i = 2; i <= n; i++)
    if (isnonleaf[i] == 0) nleafchild[p[i]]++;
  for (int i = 1; i <= n; i++)
    if (isnonleaf[i] == 1 && nleafchild[i] < 3) {
      puts("No");
      return 0;
    }
  puts("Yes");
  return 0;
}
