import sys,random,bisect from collections import deque,defaultdict import heapq from itertools import permutations from math import gcd input = lambda :sys.stdin.readline().rstrip() mi = lambda :map(int,input().split()) li = lambda :list(mi()) INF = 10**17 H,W = mi() A = [li() for i in range(H)] dp0 = [[-INF]*W for i in range(H)] dp1 = [[-INF]*W for i in range(H)] dp1[0][0] = A[0][0] for i in range(H): for j in range(W): if i!=H-1: if dp0[i][j] > A[i+1][j]: dp0[i+1][j] = max(dp0[i+1][j],dp0[i][j]+A[i+1][j]) if dp1[i][j] > A[i+1][j]: dp1[i+1][j] = max(dp1[i+1][j],dp1[i][j]+A[i+1][j]) elif (i+1,j)!=(H-1,W-1): dp0[i+1][j] = max(dp0[i+1][j],dp1[i][j]) if j!=W-1: if dp0[i][j] > A[i][j+1]: dp0[i][j+1] = max(dp0[i][j+1],dp0[i][j]+A[i][j+1]) if dp1[i][j] > A[i][j+1]: dp1[i][j+1] = max(dp1[i][j+1],dp1[i][j]+A[i][j+1]) elif (i,j+1)!=(H-1,W-1): dp0[i][j+1] = max(dp0[i][j+1],dp1[i][j]) print("Yes" if dp1[-1][-1]!=-INF or dp0[-1][-1]!=-INF else "No")