{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"描述","value":{"format":"MD","content":"数百年前,古国坎瑞亚试图洞悉天理,并将其以一个长为 $n$ 的数组记录在石碑上。\n\n起初,石碑上 $1$ 到 $n$ 的位置都空无一物。每逢一次灵感的迸发,科学官就会把一个区间的数全部更新。具体而言,科学官会在第 $i$ 次灵感迸发时将区间 $[l_i, r_i](1\\le l_i\\le r_i\\le n)$ 的所有数字替换为 $i$。\n\n在 $q$ 次灵感的眷顾下,石碑的每个位置都填上了一个数,而坎瑞亚也难逃天理的惩戒,在七神的围攻下覆灭。\n\n而你,旅行者,发现了这块石碑。虽然石碑的许多内容已经磨损,但你仍然试图复原这段古国的遗书。"}},{"title":"输入","value":{"format":"MD","content":"\n第一行包含两个整数 $n(1\\le n\\le 2\\cdot 10^5)$ 和 $q(1\\le q\\le 2\\cdot 10^5)$,表示这个数组的长度和科学官修改的次数。\n\n第二行包含 $n$ 个整数 $a_1,a_2, \\dots, a_n(0\\le a_i\\le q)$,表示经过磨损的一串数字。数字为 $0$ 代表该位置已经被磨损,真实的值可能是 $1$ 到 $q$ 之间的任何整数。"}},{"title":"输出","value":{"format":"MD","content":"如果可以复原出 $q$ 次修改后的数组,则输出 `YES`。并且在下一行输出 $n$ 个数,表示复原的结果。显然结果中不能包含 $0$。\n\n否则输出 `NO`。\n\n如果有多个可能的结果,输出任意一个即可。"}},{"title":"样例1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\n4 3\n1 0 2 3\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\nYES\n1 2 2 3\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\n3 10\n10 10 10\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\nYES\n10 10 10 \n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例3","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\n5 6\n6 5 6 2 2\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\nNO\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例4","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\n3 5\n0 0 0\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u003cpre\u003e\nYES\n5 4 2\n\u003c/pre\u003e\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"注解","value":{"format":"MD","content":"样例1的一种可行解释: $0, 0, 0, 0\\rightarrow 1, 1, 1, 1\\rightarrow 1, 2, 2, 1\\rightarrow 1, 2, 2, 3$,最后第 $2$ 个位置被磨损得到 $1, 0, 2, 3$。\n\n样例3不可复原,因为填写 $6$ 的时候一定会覆盖位置 $2$ 的 $5$,不可能得到样例中的结果。"}}]}