import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### h,w = na() a = [[i * w + j+1 for j in range(w)]for i in range(h)] b = [[0 for j in range(w)]for i in range(h)] for i in range(h): for j in range(w): if i%2: b[i][j] = a[i][-1-j] else: b[i][j] = a[i][j] b, a = [[0 for j in range(w)]for i in range(h)], b for i in range(h): for j in range(w): if j%2: b[i][j] = a[-1-i][j] else: b[i][j] = a[i][j] Yes() for i in b: print(*i)