#include <bits/stdc++.h>
using namespace std;
int f[1010], sum[1010], n, s1[1010];
bool c = true;
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> f[i];
    sum[f[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (sum[i] == 0) s1[f[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (sum[i] != 0)
      if (s1[i] < 3) c = false;
  }
  if (c)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
