{"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":"HTML","content":"\n最初有一个由n个整数组成的数组。其中的位置编号为1到n。\n\n在阵列上执行了正确的q查询。在第ii个查询期间,选择了一些段(li,ri)(1≤li≤ri≤n),并且从li到ri的位置上的元素值变为i。无法更改查询的顺序并应用了所有q查询。还已知从1到n的每个位置都被至少一个段覆盖。\n\n我们可以为您提供有关检查是否可以通过上述查询获得某些给定数组(由1到q的值为n的整数组成)的问题。但是,我们认为这对你来说太容易了。\n\n所以我们介绍的增强功能如下。选择此数组中的一些位置(可能为空),并将这些位置上的元素值设置为0。\n\n您的任务是检查上述查询是否可以获取此数组。如果可以获得,则恢复此阵列。\n\n如果有多个可能的阵列,则打印其中任何一个。"}},{"title":"Input","value":{"format":"HTML","content":"\n第一行包含两个整数n和q(1≤n,q≤2⋅10^ 5) - 数组的元素数和在其上执行的查询数。\n\n第二行包含n个整数a1,a2,...,an(0≤ai≤q) - 得到的数组。如果某个位置j处的元素等于0,则该位置处的元素值可以是1到q之间的任何整数。"}},{"title":"Output","value":{"format":"HTML","content":"如果可以通过执行q查询获得阵列a,则打印“是”。对于每个查询,分别选择段(li,ri)(1≤li≤ri≤n)。从1到n的每个位置应至少由一个段覆盖。\n\n否则打印“否”。\n\n如果可以获得某个数组,则在第二行打印n个整数 - 第i个数字应该等于结果数组的第i个元素,并且应该具有从1到q的值。应该通过执行精确的q查询来获得此数组。\n\n如果有多个可能的阵列,则打印其中任何一个。"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e4 3\u003cbr\u003e1 0 2 3\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\u003cbr\u003e1 2 2 3\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3 10\u003cbr\u003e10 10 10\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\u003cbr\u003e10 10 10 \u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5 6\u003cbr\u003e6 5 6 2 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eNO\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3 5\u003cbr\u003e0 0 0\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\u003cbr\u003e5 4 2\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\n在第一个示例中,您还可以将0替换为1但不替换为3。\n\n在第二个例子中,当段为(1,3)时,在查询10之前选择哪些段并不重要。\n\n第三个例子展示了这样一个事实,即查询的顺序不能改变,你不能先将(1,3)设置为6,然后将更改(2,2)设置为5.应该在之前应用5的段6段。\n\n第四个例子有很多正确的结果数组。"}}]}