h, w = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(h)] DP = [[[-1 for _ in range(2)] for _ in range(w)] for _ in range(h)] DP[0][0][0] = A[0][0] Directions = [(1, 0), (0, 1)] for i in range(h): for j in range(w): for di, dj in Directions: ni, nj = i + di, j + dj if ni < h and nj < w: if DP[i][j][0] != -1: if DP[i][j][0] > A[ni][nj]: DP[ni][nj][0] = max(DP[ni][nj][0], DP[i][j][0] + A[ni][nj]) else: if ni != h - 1 and nj != w - 1: DP[ni][nj][1] = max(DP[ni][nj][1], DP[i][j][0]) if DP[i][j][1] != -1: if DP[i][j][1] > A[ni][nj]: DP[ni][nj][1] = max(DP[ni][nj][1], DP[i][j][1] + A[ni][nj]) if DP[-1][-1][0] != -1: print("Yes") else: if DP[-1][-1][1] > A[-1][-1]: print("Yes") else: print("No")