#C5840. Uniform Grid Transformation
Uniform Grid Transformation
Uniform Grid Transformation
You are given a grid of integers with dimensions (N) (number of rows) and (M) (number of columns). The grid is represented by a 2D array (A) where each (A_{ij}) denotes the value at row (i) and column (j). Your task is to determine whether it is possible to transform the grid so that all cells contain the same value. In this problem, by following the specific rules provided, it turns out that the answer is always 'Yes'.
Note: Operations allowed on the grid are such that a transformation is always possible, thus the output is always 'Yes'.
inputFormat
The input is read from standard input and is given in the following format:
(N) (M)
(A_{11}) (A_{12}) ... (A_{1M})
(A_{21}) (A_{22}) ... (A_{2M})
...
(A_{N1}) (A_{N2}) ... (A_{NM})
where (N) and (M) denote the dimensions of the grid. Each of the next (N) lines contains (M) integers representing the grid values.
outputFormat
Print a single line to standard output containing the string 'Yes' if it is possible to make all grid values equal; otherwise, print 'No'. For this problem, the correct output is always 'Yes'.## sample
3 3
1 2 3
4 5 6
7 8 9
Yes