AT_abc425_b [ABC425B] Find Permutation 2

Description

You are given an integer sequence $ A=(A_1,A_2,\ldots,A_N) $ of length $ N $ . Here, each element of $ A $ is either $ -1 $ or an integer between $ 1 $ and $ N $ , inclusive. Determine whether there exists an integer sequence $ P=(P_1,P_2,\ldots,P_N) $ of length $ N $ that satisfies all of the following conditions, and if it exists, find one. - $ P $ is a permutation of $ (1,2,\ldots,N) $ . - For $ i=1,2,\ldots,N $ , if $ A_i \neq -1 $ , then $ P_i=A_i $ holds.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $

Output Format

If there is no $ P $ that satisfies all conditions, output `No`. Otherwise, output $ P $ that satisfies all conditions in the following format: > Yes $ P_1 $ $ P_2 $ $ \ldots $ $ P_N $ If there are multiple $ P $ that satisfy all conditions, any of them may be output.

Explanation/Hint

### Sample Explanation 1 $ P=(3,1,2,4) $ satisfies all conditions. Besides this, $ P=(1,3,2,4) $ or $ P=(4,3,2,1) $ also satisfies all conditions. ### Sample Explanation 2 There is no $ P $ that satisfies all conditions. ### Constraints - $ 1\le N\le 10 $ - $ A_i=-1 $ or $ 1\le A_i \le N $ - All input values are integers.