#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
bool isLeaf[N];
vector<int> g[N];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; ++i) {
    int p;
    cin >> p;
    g[p].push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    if (g[i].size() == 0) {
      isLeaf[i] = true;
    }
  }
  bool ans = true;
  for (int i = 1; i <= n; ++i) {
    if (!isLeaf[i]) {
      int ctr = 0;
      for (auto &j : g[i]) {
        if (isLeaf[j]) {
          ++ctr;
        }
      }
      if (ctr < 3) {
        ans = false;
        break;
      }
    }
  }
  if (ans) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}
