h, w = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(h)] dp = [[0] * w for _ in range(h)] dp2 = [[0] * w for _ in range(h)] dp[0][0] = A[0][0] dp2[0][0] = A[0][0] for i in range(h): for j in range(w): if i == h - 1 and j == w - 1: break if i != 0: dp2[i][j] = max(dp2[i][j], dp[i - 1][j]) if A[i][j] < dp[i - 1][j]: dp[i][j] = max(dp[i][j], dp[i - 1][j] + A[i][j]) if A[i][j] < dp2[i - 1][j]: dp2[i][j] = max(dp2[i][j], dp2[i - 1][j] + A[i][j]) if j != 0: dp2[i][j] = max(dp2[i][j], dp[i][j - 1]) if A[i][j] < dp[i][j - 1]: dp[i][j] = max(dp[i][j], dp[i][j - 1] + A[i][j]) if A[i][j] < dp2[i][j - 1]: dp2[i][j] = max(dp2[i][j], dp2[i][j - 1] + A[i][j]) if max(dp2[-1][-2], dp2[-2][-1]) > A[-1][-1]: print("Yes") else: print("No")