Problem: 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>

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int Y[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int X[] = {0, 0, -1, 1, -1, 1, -1, 1};
int DIR4 = 4;
int DIR8 = 8;
long long power(long long a, long long n) {
  if (a == 0) return 0;
  if (a == 1 || n == 0) return 1;
  if (n == 1) return a % 1000000007;
  long long t = power(a, n / 2);
  t = t * t % 1000000007;
  if (n & 1) return t * a % 1000000007;
  return t;
}
void keywordsForAutocompletion() {}
int popcount(long long a) {
  int c = 0;
  while (a) {
    c++;
    a -= a & -a;
  }
  return c;
}
void factorize(int a) {}
void update(int tree[], int idx, int val, int maxval) {
  for (; idx <= maxval; idx += idx & -idx) {
    tree[idx] += val;
  }
}
int read(int tree[], int idx) {
  long long sum = 0;
  for (; idx > 0; idx -= idx & -idx) {
    sum += tree[idx];
  }
  return sum;
}
struct node2 {
  int id, val;
  node2() {
    static int ctx = 1;
    id = ctx++;
  };
  node2(int a, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0) {
    val = a;
  }
};
struct comp2 {
  bool operator()(int a, int b) { return b < a; }
};
bool cmp2(int a, int b) { return b < a; }
struct node {
  int id, val;
  node() {
    static int ctx = 1;
    id = ctx++;
  };
  node(int a, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0) {
    val = a;
  }
};
struct comp {
  bool operator()(int a, int b) { return b < a; }
};
bool cmp(int a, int b) { return b < a; }
int n, m, a, b, c, d, k, h[200009], w, x, y, p, q, t, res, ma, mi, T,
    act = 0, pas = 1, cur, flag, now;
int uu, vv, ww, l, r;
int dp, deg[200009], cnt, sum, sub, sz, lim, tmp, type, add, layerConv[200009];
char s[200009], ch;
double f, z, e;
vector<int> ans, layer[200009], vec;
set<int> v[200009];
map<int, int> mapp;
void print() {
  for (int i = 0; i < n; i++) {
    cout << i << " : ";
    for (auto u : layer[i]) cout << u << " ";
    cout << endl;
  }
  cout << endl;
}
void print2() {
  for (int i = 1; i < n + 1; i++) {
    cout << i << " : ";
    for (auto u : v[i]) cout << u << " ";
    cout << endl;
  }
  cout << endl;
}
void input() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i < n + 1; i++) {
    cin >> p;
    if (p != 0) {
      v[i].insert(p);
      v[p].insert(i);
      deg[p]++;
      deg[i]++;
    }
  }
}
int dfs(int id, int par) {
  int t = 0;
  for (auto u : v[id]) {
    if (u == par) continue;
    t = max(t, dfs(u, id));
  }
  layer[t].push_back(id);
  layerConv[id] = t;
  return t + 1;
}
void del(int id) {
  queue<int> q;
  q.push(id);
  while (!q.empty()) {
    int top = q.front();
    q.pop();
    ans.push_back(top);
    for (auto u : v[top])
      if (layerConv[u] < layerConv[top]) q.push(u);
  }
}
void solve() {
  dfs(1, 0);
  for (int l = 0; l < n; l++) {
    for (auto u : layer[l]) {
      if (deg[u] % 2 == 0) {
        h[u] = 1;
        ans.push_back(u);
        vec.clear();
        for (auto u2 : v[u]) {
          deg[u2]--;
          deg[u]--;
          vec.push_back(u2);
          if (layerConv[u2] < l && !h[u2]) del(u2);
        }
        for (auto u2 : vec) {
          v[u].erase(u2);
          v[u2].erase(u);
        }
      }
    }
  }
}
void output() {
  if (ans.size() == n) {
    cout << "YES" << endl;
    for (auto u : ans) cout << u << endl;
  } else
    cout << "NO";
}
int main() {
  input();
  solve();
  output();
  return 0;
}