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