H,W = map(int,input().split()) A = [list(map(int,input().split())) for _ in range(H)] inf = 10 ** 14 dp = [[[-inf] * 2 for _ in range(W)] for _ in range(H)] dp[0][0][0] = A[0][0] for wa in range(0,H + W): for i in range(H): j = wa - i if 0 <= j < W: for u,v in [(1,0),(0,1)]: if 0 <= i + u < H and 0 <= j + v < W: if dp[i][j][0] > A[i + u][j + v]: dp[i + u][j + v][0] = max(dp[i + u][j + v][0],dp[i][j][0] + A[i + u][j + v]) else: dp[i + u][j + v][1] = max(dp[i + u][j + v][1],dp[i][j][0]) if dp[i][j][1] > A[i + u][j + v]: dp[i + u][j + v][1] = max(dp[i + u][j + v][1],dp[i][j][1] + A[i + u][j + v]) if dp[-1][-1][0] >= 0 or dp[-1][-1][1] >= 0: print('Yes') else: print('No')