Increasing diagonals

Given a rectangular matrix n×mn \times m, and an initial position in the matrix, determine whether the four diagonals starting at the initial position have elements in strictly increasing order or not.

Input

The input is formed by several cases. Each case starts with the number of rows nn and the number of columns mm, followed by nn lines with mm integers each. The case ends with the row and colummn of the initial position (starting at 0).

Output

For each case, write “yes” or “no” accordingly.

Your program should follow a right programming style. Please, include the appropriate comments.

Problem information

Author: Unknown
Translator: Maria Serna

Generation: 2026-01-25T14:00:58.792Z

© Jutge.org, 2006–2026.
https://jutge.org