#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int MAX = 1010;
const int mod = 1e9 + 7;
vector<int> ind[MAX];
int num[MAX];
int t[MAX];
int parent[MAX];
bool v[MAX];
string s = "Yes";
void search(int i) {
  if (ind[i].size() > 0) {
    num[parent[i]]--;
    for (int j = 0; j < ind[i].size(); j++) {
      search(ind[i][j]);
    }
  } else {
    v[i] = true;
  }
}
int main(int argc, char *argv[]) {
  int i, j, k, N;
  cin >> N;
  for (i = 1; i < N; i++) {
    scanf("%d", &t[i]);
  }
  for (i = 1; i < N; i++) {
    ind[t[i]].push_back(i + 1);
    num[t[i]]++;
    parent[i + 1] = t[i];
  }
  search(1);
  for (i = 1; i < N; i++) {
    if (!v[i] && num[i] < 3) {
      s = "No";
      break;
    }
  }
  cout << s << endl;
  return 0;
}
