Half Turns
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
Special Judge, 64bit IO Format: %lld

题目描述

Given two even integers n and m, construct a matrix M satisfying following constraints:
  • The number of rows and columns of M are n and m respectively.
  • For each integer i , i appears exactly once in M.
  • For each two adjacent integers i and , denoting and , then holds.
  • The number of turning integers is exactly , where i is a turning integer iff the three integers i-1, i and are not in the same row or the same column.
If multiple solution exist, print any one of them. If no solution exist, report it.

输入描述:

The only line contains two even integers n and m .

输出描述:

If no solution, print "No" (without quotes) in one line.
If solution exists, print "Yes" (without quotes) in the first line. Then print n lines each containing m integers , denoting the answer matrix.
示例1

输入

复制
4 4

输出

复制
Yes
2 3 4 5
1 8 7 6
16 9 10 11
15 14 13 12

说明

In the sample case, the number of turning integers is 8, which equals \frac{4\times 4}{2}, and the 8 turning integers are 2,5,6,8,9,11,12,15.