h, w = map(int, input().split()) ans = [[] for _ in range(h)]; p = 1; q = h*w for i in range(h): if i%2: while True: ans[i].append(q); q -= 1 if len(ans[i]) == w: break ans[i].append(p); p += 1 if len(ans[i]) == w: break else: while True: ans[i].append(p); p += 1 if len(ans[i]) == w: break ans[i].append(q); q -= 1 if len(ans[i]) == w: break print("Yes") for s in ans: print(*s)