Problem: 2^N players competed in a tournament. Each player has a unique ID number from 1 through 2^N. When two players play a match, the player with the smaller ID always wins.

This tournament was a little special, in which losers are not eliminated to fully rank all the players.

We will call such a tournament that involves 2^n players a full tournament of level n. In a full tournament of level n, the players are ranked as follows:

* In a full tournament of level 0, the only player is ranked first.
* In a full tournament of level n\ (1 \leq n), initially all 2^n players are lined up in a row. Then:
* First, starting from the two leftmost players, the players are successively divided into 2^{n-1} pairs of two players.
* Each of the pairs plays a match. The winner enters the "Won" group, and the loser enters the "Lost" group.
* The players in the "Won" group are lined up in a row, maintaining the relative order in the previous row. Then, a full tournament of level n-1 is held to fully rank these players.
* The players in the "Lost" group are also ranked in the same manner, then the rank of each of these players increases by 2^{n-1}.



For example, the figure below shows how a full tournament of level 3 progresses when eight players are lined up in the order 3,4,8,6,2,1,7,5. The list of the players sorted by the final ranking will be 1,3,5,6,2,4,7,8.

<image>

Takahashi has a sheet of paper with the list of the players sorted by the final ranking in the tournament, but some of it blurred and became unreadable. You are given the information on the sheet as a sequence A of length N. When A_i is 1 or greater, it means that the i-th ranked player had the ID A_i. If A_i is 0, it means that the ID of the i-th ranked player is lost.

Determine whether there exists a valid order in the first phase of the tournament which is consistent with the sheet. If it exists, provide one such order.

Constraints

* 1 \leq N \leq 18
* 0 \leq A_i \leq 2^N
* No integer, except 0, occurs more than once in A_i.

Input

Input is given from Standard Input in the following format:


N
A_1 A_2 ... A_{2^N}


Output

If there exists a valid order in the first phase of the tournament, print `YES` first, then in the subsequent line, print the IDs of the players sorted by the final ranking, with spaces in between. If there is no such order, print `NO` instead.

Examples

Input

3
0 3 0 6 0 0 0 8


Output

YES
3 4 8 6 2 1 7 5


Input

1
2 1


Output

NO

Solution (in CPP):

Solution:
#include<queue>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

int M, K;
int A[1<<18];
int mi[1<<18], ma[1<<18];
pair<int, int> X[1<<18];
int ans[1<<18];

int rev(int x) {
    int r = 0;
    REP (i, K) if (x>>i&1) r |= 1<<(K-1-i);
    return r;
}

void MAIN() {
    scanf("%d", &K);
    M = 1<<K;
    REP (i, M) scanf("%d", A+i), A[i]--;
    memset(ma, 0x3f, sizeof ma);
    memset(mi, 0xc0, sizeof mi);
    REP (i, M) if (A[i] != -1) {
	mi[rev(i)] = ma[rev(i)] = A[i];
    }

    REP (t, K) REP (i, M) if (i>>t&1) {
	int k = i ^ (1<<t);
	amin(ma[k], ma[i]-1);
	amax(mi[i], mi[k]+1);
    }

    REP (i, M) {
	if (ma[i] < mi[i]) {
	    puts("NO");
	    return;
	} else {
	    X[i] = make_pair(mi[i], i);
	}
    }

    sort(X, X+M);

    int pos = 0;
    priority_queue<pair<int, int>> Q;

    REP (i, M) {
	while (pos < M && X[pos].first <= i) {
	    Q.emplace(-ma[X[pos].second], X[pos].second);
	    pos++;
	}
	if (Q.empty()) {
	    puts("NO");
	    return;
	}

	int limit = -Q.top().first;
	int idx = Q.top().second;
	Q.pop();
	if (i <= limit) {
	    ans[idx] = i+1;
	} else {
	    puts("NO");
	    return;
	}
    }

    puts("YES");
    rprintf("%d", ans, ans+M);
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}