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>
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
using namespace std;
void itval(istream_iterator<string> it) {}
template <typename T, typename... Args>
void itval(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  itval(++it, args...);
}
const long long int MOD = 1e9 + 7;
template <typename T>
inline void print(T x) {
  cout << x << "\n";
}
template <typename T>
inline void printvec(T x) {
  for (auto a : x) cout << a << ' ';
  cout << '\n';
}
struct custom {
  bool operator()(const pair<long long int, long long int> &p1,
                  const pair<long long int, long long int> &p2) const {
    return p1.first < p2.first;
  }
};
long long int get_pow(long long int a, long long int b, long long int M = MOD) {
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % M;
    a = (a * a) % M;
    b >>= 1;
  }
  return res;
}
const long long int N = 2e5 + 5, inf = 4e18;
int deg[N], done[N];
std::vector<int> adj[N], nxt[N];
vector<int> order;
void travel(int s) {
  order.push_back(s + 1);
  for (auto x : nxt[s]) travel(x);
}
void dfs(int s, int p) {
  for (auto x : adj[s]) {
    if (x != p) {
      dfs(x, s);
    }
  }
  int cnt = 0;
  vector<int> lef;
  for (auto x : adj[s]) {
    if (x == p) continue;
    if (done[x])
      cnt++;
    else
      lef.push_back(x);
  }
  if ((deg[s] - cnt) % 2 == 0) {
    order.push_back(s + 1);
    done[s] = 1;
    for (auto x : lef) travel(x);
  } else {
    for (auto x : lef) nxt[s].push_back(x);
  }
}
void solve() {
  int n, x;
  cin >> n;
  for (long long int i = (long long int)0; i < (long long int)(n); i++) {
    cin >> x;
    x--;
    if (x != -1) {
      adj[x].push_back(i);
      adj[i].push_back(x);
      deg[x]++;
      deg[i]++;
    }
  }
  if (n == 1) {
    cout << "YES\n1\n";
    return;
  }
  for (long long int i = (long long int)0; i < (long long int)(n); i++) {
    if (deg[i] == 1) {
      dfs(i, -1);
      break;
    }
  }
  if (order.size() != n) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
  for (auto x : order) cout << x << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test = 1;
  clock_t z = clock();
  for (long long int tes = (long long int)0; tes < (long long int)(test);
       tes++) {
    solve();
  }
  fprintf(stderr, "Total Time:%.4f\n", (double)(clock() - z) / CLOCKS_PER_SEC),
      fflush(stderr);
  return 0;
}
