{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e\n\t\u003cp align\u003d\"justify\"\u003e\r\nFor sure, the love mobiles will roll again on this summer\u0027s street parade. Each year, the organisers decide on a fixed order for the decorated trucks. Experience taught them to keep free a side street to be able to bring the trucks into order.\r\n\u003cbr\u003e\u003cbr\u003e\r\nThe side street is so narrow that no two cars can pass each other. Thus, the love mobile that enters the side street last must necessarily leave the side street first. Because the trucks and the ravers move up closely, a truck cannot drive back and re-enter the side street or the approach street.\r\n\u003cbr\u003e\u003cbr\u003e\r\nYou are given the order in which the love mobiles arrive. Write a program that decides if the love mobiles can be brought into the order that the organisers want them to be.\r\n\u003c/p\u003e\r\n\u003ch3\u003eInput\u003c/h3\u003e\r\n\u003cp align\u003d\"justify\"\u003e\r\nThere are several test cases.\r\nThe first line of each test case contains a single number n, the number of love mobiles.\r\nThe second line contains the numbers 1 to n in an arbitrary order. All the numbers are separated by single spaces. These numbers indicate the order in which the trucks arrive in the approach street.\r\nNo more than 1000 love mobiles participate in the street parade. Input ends with number 0.\r\n\u003c/p\u003e\r\n\u003ch3\u003eOutput\u003c/h3\u003e\r\n\u003cp align\u003d\"justify\"\u003e\r\nFor each test case your program has to output a line containing a single word \"\u003ctt\u003eyes\u003c/tt\u003e\" if the love mobiles can be re-ordered with the help of the side street, and a single word \"\u003ctt\u003eno\u003c/tt\u003e\" in the opposite case.\r\n\u003c/p\u003e\r\n\u003ch3\u003eExample\u003c/h3\u003e\r\n\u003cdiv\u003e\u003ctable class\u003d\"vjudge_sample\"\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\u003e5\r\n5 1 2 4 3 \r\n0\r\n\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eyes\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c/div\u003e\r\n\u003ch3\u003eIllustration\u003c/h3\u003e\r\n\u003cp\u003e\r\nThe sample input reflects the following situation:\u003cbr\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/e9d2b04a8eea145c4c7b7b9d41a892d7?v\u003d1714242913\"\u003e\r\n\u003c/p\u003e\u003cp\u003e\r\nThe five trucks can be re-ordered in the following way:\u003cbr\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/3850c71eea4525e748c0f698bbf443c9?v\u003d1714242913\"\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/e86520ee34cb455854fbddcb4a14de0b?v\u003d1714242913\"\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/8a292d5d29444d37079f9ec1e2c04685?v\u003d1714242913\"\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/79d780de876deb764d825b130405cea6?v\u003d1714242913\"\u003e\r\n\u003cimg src\u003d\"CDN_BASE_URL/a94cce1fd4af9d5cfccda03c0c558bea?v\u003d1714242913\"\u003e\r\n\n\u003c/p\u003e\u003c/div\u003e"}}]}