vecs = [(0,1),(1,0)] h,w = map(int,input().split()) a = [list(map(int,input().split())) for _ in range(h)] dp = [[[0] * w for _ in range(h)] for _ in range(2)] dp[0][0][0] = a[0][0] for i in range(h): for j in range(w): for vi,vj in vecs: ni,nj = vi + i,vj + j if 0 <= ni <= h-1 and 0 <= nj <= w-1: for k in range(2): if dp[k][i][j] > a[ni][nj]: dp[k][ni][nj] = max(a[ni][nj]+dp[k][i][j],dp[k][ni][nj]) else: if k == 0: dp[k+1][ni][nj] = max(dp[k+1][ni][nj],dp[k][i][j]) ans = "No" last = a[-1][-1] if dp[0][h-2][w-1] > last:ans = "Yes" if dp[0][h-1][w-2] > last:ans = "Yes" if dp[1][h-2][w-1] > last:ans = "Yes" if dp[1][h-1][w-2] > last:ans = "Yes" print(ans)