#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar[n + 1], hash[1000] = {0};
  for (int i = 2; i < n + 1; i++) {
    cin >> ar[i];
    hash[ar[i]]++;
  }
  ar[0] = ar[1] = -1;
  for (int i = 2; i < n + 1; i++) {
    if (hash[i] != 0) hash[ar[i]]--;
  }
  sort(ar, ar + n + 1);
  for (int i = 1; i <= n + 1; i++) {
    if ((hash[i] > 0 && hash[i] < 3) ||
        (hash[i] == 0 && binary_search(ar, ar + n + 1, i))) {
      cout << "No";
      break;
    } else if (i == n + 1)
      cout << "Yes";
  }
  return 0;
}
