CF777C Alyona and Spreadsheet
Description
During the lesson small girl Alyona works with one famous spreadsheet computer program and learns how to edit tables.
Now she has a table filled with integers. The table consists of $ n $ rows and $ m $ columns. By $ a_{i,j} $ we will denote the integer located at the $ i $ -th row and the $ j $ -th column. We say that the table is sorted in non-decreasing order in the column $ j $ if $ a_{i,j}
Input Format
The first line of the input contains two positive integers $ n $ and $ m $ ( $ 1
Output Format
Print "Yes" to the $ i $ -th line of the output if the table consisting of rows from $ l_{i} $ to $ r_{i} $ inclusive is sorted in non-decreasing order in at least one column. Otherwise, print "No".
Explanation/Hint
In the sample, the whole table is not sorted in any column. However, rows 1–3 are sorted in column $ 1 $ , while rows 4–5 are sorted in column $ 3 $ .