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] for i in range(h): for j in range(w): if i > 0 and j > 0: if max(dp[i - 1][j], dp[i][j - 1]) > a[i][j]: dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]) + a[i][j] if max(dp2[i - 1][j], dp2[i][j - 1]) > a[i][j]: dp2[i][j] = max(max(dp2[i - 1][j], dp2[i][j - 1]) + a[i][j], max(dp[i - 1][j], dp[i][j - 1])) else: dp2[i][j] = max(dp[i - 1][j], dp[i][j - 1]) elif i > 0: if dp[i - 1][j] > a[i][j]: dp[i][j] = dp[i - 1][j] + a[i][j] if dp[i - 1][j] > a[i][j]: dp2[i][j] = max(dp2[i - 1][j] + a[i][j], dp[i - 1][j]) else: dp2[i][j] = dp[i - 1][j] elif j > 0: if dp[i][j - 1] > a[i][j]: dp[i][j] = dp[i][j - 1] + a[i][j] if dp[i][j - 1] > a[i][j]: dp2[i][j] = max(dp2[i][j - 1] + a[i][j], dp[i][j - 1]) else: dp2[i][j] = dp[i][j - 1] if dp[-1][-1] > a[-1][-1] or dp2[-1][-1] > a[-1][-1]: print('Yes') else: print('No')