#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000;
int p[maxn];
int d[maxn];
int g[maxn];
int main() {
  bool f = 1;
  int n, tmp;
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> tmp;
    p[i] = tmp - 1;
  }
  for (int i = 0; i < n; i++) d[p[i]]++;
  for (int i = 0; i < n; i++)
    if (d[i] == 0) g[p[i]]++;
  for (int i = 0; i < n; i++)
    if (d[i] != 0 && (g[i] < 3)) f = 0;
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
