#include <bits/stdc++.h>
using namespace std;
int n;
std::vector<int> ch[1005];
bool dfs(const int &u) {
  if (!ch[u].size()) return true;
  int res = 0;
  if (ch[u].size()) {
    for (auto it = ch[u].begin(); it != ch[u].end(); it++) {
      if (!(ch[*it].size())) res++;
    }
  }
  if (res >= 3)
    return true;
  else
    return false;
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int u;
    cin >> u;
    ch[u].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (!dfs(i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
