#include <bits/stdc++.h>
using namespace std;
const int INF32 = 1E9;
const long long INF64 = 4E18;
const long long M = 1E9 + 7;
const double EPS = 1E-9;
const double PI = 2 * acos(0);
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& p) {
  os << "[ ";
  for (T x : p) os << x << " ";
  os << "]" << '\n';
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T>& p) {
  os << "{ ";
  for (T x : p) os << x << " ";
  os << "}" << '\n';
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const map<Tk, Tv>& p) {
  os << "{ ";
  for (pair<Tk, Tv> x : p) os << x << " ";
  os << "}" << '\n';
  return os;
}
template <typename Tk, typename Tv>
ostream& operator<<(ostream& os, const pair<Tk, Tv>& p) {
  os << "{" << p.first << ',' << p.second << "}";
  return os;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("tupni.txt", "r")) {
    freopen("tupni.txt", "r", stdin);
    freopen("tuptuo.txt", "w", stdout);
  }
  int n;
  cin >> n;
  vector<vector<long long> > g(n + 1);
  for (int i = 2; i <= n; ++i) {
    int p;
    cin >> p;
    g[p].push_back(i);
  }
  bool flag = true;
  for (int i = 1; i <= n; ++i) {
    int cnt = 0;
    for (int j = 0; j < (int)g[i].size(); ++j) {
      int v = g[i][j];
      if ((int)g[v].size() == 0) {
        cnt++;
      }
    }
    if ((int)g[i].size() != 0) {
      if (cnt < 3) {
        flag = false;
        break;
      }
    }
  }
  if (flag)
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
  return 0;
}
