You are given a tree (a graph with n vertices and n - 1 edges in which it's possible to reach any vertex from any other vertex using only its edges).

A vertex can be destroyed if this vertex has even degree. If you destroy a vertex, all edges connected to it are also deleted.

Destroy all vertices in the given tree or determine that it is impossible.

Input

The first line contains integer n (1 ≤ n ≤ 2·105) — number of vertices in a tree.

The second line contains n integers p1, p2, ..., pn (0 ≤ pi ≤ n). If pi ≠ 0 there is an edge between vertices i and pi. It is guaranteed that the given graph is a tree.

Output

If it's possible to destroy all vertices, print "YES" (without quotes), otherwise print "NO" (without quotes).

If it's possible to destroy all vertices, in the next n lines print the indices of the vertices in order you destroy them. If there are multiple correct answers, print any.

Examples

Input

5
0 1 2 1 2


Output

YES
1
2
3
5
4


Input

4
0 1 2 3


Output

NO

Note

In the first example at first you have to remove the vertex with index 1 (after that, the edges (1, 2) and (1, 4) are removed), then the vertex with index 2 (and edges (2, 3) and (2, 5) are removed). After that there are no edges in the tree, so you can remove remaining vertices in any order.

<image>
#include <bits/stdc++.h>
using namespace std;
const int ROOT = 1;
const int maxn = 200005;
int n;
int f[maxn][2];
vector<vector<int>> next_node;
bool is_leaf(int x) {
  if (next_node[x].size() == 0) return true;
  if (next_node[x].size() == 1 && x != ROOT) return true;
  return false;
}
bool dfs(int root, int parent) {
  if (is_leaf(root)) {
    f[root][0] = 1;
    f[root][1] = 0;
    return true;
  }
  set<int> z, o, b, n;
  for (auto x : next_node[root]) {
    if (x == parent) continue;
    if (!dfs(x, root)) return false;
    if (f[x][0] && f[x][1]) {
      b.insert(x);
    } else if (f[x][0]) {
      z.insert(x);
    } else if (f[x][1]) {
      o.insert(x);
    } else {
      n.insert(x);
    }
  }
  if (n.size()) return false;
  for (auto z_flag : {0, 1}) {
    if (b.size()) {
      f[root][z_flag] = 1;
    } else {
      f[root][z_flag] = (z_flag + z.size()) % 2 == 0;
    }
  }
  return f[root][0] || f[root][1];
}
void find(int root, int z_flag, int parent) {
  if (is_leaf(root)) {
    printf("%d\n", root);
    return;
  }
  set<int> z, o, b, n;
  for (auto x : next_node[root]) {
    if (x == parent) continue;
    if (f[x][0] && f[x][1]) {
      b.insert(x);
    } else if (f[x][0]) {
      z.insert(x);
    } else if (f[x][1]) {
      o.insert(x);
    } else {
      n.insert(x);
    }
  }
  set<int> zero_set, one_set;
  if ((z_flag + z.size()) % 2 == 1) {
    int x = *(b.begin());
    b.erase(x);
    zero_set.insert(x);
  }
  while (z.size()) {
    int x = *(z.begin());
    z.erase(x);
    zero_set.insert(x);
  }
  while (o.size()) {
    int x = *(o.begin());
    o.erase(x);
    one_set.insert(x);
  }
  while (b.size()) {
    int x = *(b.begin());
    b.erase(x);
    one_set.insert(x);
  }
  while (one_set.size()) {
    int x = *(one_set.begin());
    one_set.erase(x);
    find(x, 1, root);
  }
  printf("%d\n", root);
  while (zero_set.size()) {
    int x = *(zero_set.begin());
    zero_set.erase(x);
    find(x, 0, root);
  }
}
int main() {
  scanf("%d", &n);
  next_node.resize(n + 1);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    if (x == 0) continue;
    next_node[i].push_back(x);
    next_node[x].push_back(i);
  }
  dfs(ROOT, 0);
  if (!f[ROOT][0]) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
    find(ROOT, 0, 0);
  }
  return 0;
}
