h, w = map(int, input().split()) if h == 2: print("Yes"); print(*range(1, w+1)); print(*range(2*w, w, -1)) elif w == 2: print("Yes"); for i in range(h): print(1+i, 2*h-i) elif h == w == 3: print("Yes"); print(1, 8, 4); print(9, 3, 6); print(2, 7, 5) else: print("No")