{"trustable":true,"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eVasya has an array $$$a_1, a_2, \\dots, a_n$$$.\u003c/p\u003e\u003cp\u003eYou don\u0027t know this array, but he told you $$$m$$$ facts about this array. The $$$i$$$-th fact is a triple of numbers $$$t_i$$$, $$$l_i$$$ and $$$r_i$$$ ($$$0 \\le t_i \\le 1, 1 \\le l_i \u0026lt; r_i \\le n$$$) and it means:\u003c/p\u003e\u003cul\u003e \u003cli\u003e if $$$t_i\u003d1$$$ then subbarray $$$a_{l_i}, a_{l_i + 1}, \\dots, a_{r_i}$$$ is sorted in non-decreasing order; \u003c/li\u003e\u003cli\u003e if $$$t_i\u003d0$$$ then subbarray $$$a_{l_i}, a_{l_i + 1}, \\dots, a_{r_i}$$$ is not sorted in non-decreasing order. A subarray is not sorted if there is at least one pair of consecutive elements in this subarray such that the former is greater than the latter. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eFor example if $$$a \u003d [2, 1, 1, 3, 2]$$$ then he could give you three facts: $$$t_1\u003d1, l_1\u003d2, r_1\u003d4$$$ (the subarray $$$[a_2, a_3, a_4] \u003d [1, 1, 3]$$$ is sorted), $$$t_2\u003d0, l_2\u003d4, r_2\u003d5$$$ (the subarray $$$[a_4, a_5] \u003d [3, 2]$$$ is not sorted), and $$$t_3\u003d0, l_3\u003d3, r_3\u003d5$$$ (the subarray $$$[a_3, a_5] \u003d [1, 3, 2]$$$ is not sorted).\u003c/p\u003e\u003cp\u003eYou don\u0027t know the array $$$a$$$. Find \u003cspan class\u003d\"tex-font-style-bf\"\u003eany\u003c/span\u003e array which satisfies all the given facts.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains two integers $$$n$$$ and $$$m$$$ ($$$2 \\le n \\le 1000, 1 \\le m \\le 1000$$$).\u003c/p\u003e\u003cp\u003eEach of the next $$$m$$$ lines contains three integers $$$t_i$$$, $$$l_i$$$ and $$$r_i$$$ ($$$0 \\le t_i \\le 1, 1 \\le l_i \u0026lt; r_i \\le n$$$).\u003c/p\u003e\u003cp\u003eIf $$$t_i \u003d 1$$$ then subbarray $$$a_{l_i}, a_{l_i + 1}, \\dots , a_{r_i}$$$ is sorted. Otherwise (if $$$t_i \u003d 0$$$) subbarray $$$a_{l_i}, a_{l_i + 1}, \\dots , a_{r_i}$$$ is not sorted.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf there is no array that satisfies these facts in only line print \u003cspan class\u003d\"tex-font-style-tt\"\u003eNO\u003c/span\u003e (in any letter case).\u003c/p\u003e\u003cp\u003eIf there is a solution, print \u003cspan class\u003d\"tex-font-style-tt\"\u003eYES\u003c/span\u003e (in any letter case). In second line print $$$n$$$ integers $$$a_1, a_2, \\dots, a_n$$$ ($$$1 \\le a_i \\le 10^9$$$) — the array $$$a$$$, satisfying all the given facts. If there are multiple satisfying arrays you can print any of them.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e7 4\n1 1 3\n1 2 5\n0 5 6\n1 6 7\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n1 2 2 3 5 4 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4 2\n1 1 4\n0 2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}