import itertools as iter import collections as coll import heapq as hq import bisect as bis from decimal import Decimal as dec from functools import cmp_to_key import math import sys #import pypyjit #pypyjit.set_param('max_unroll_recursion=-1') sys.setrecursionlimit(10 ** 6) inp = sys.stdin.readline input = lambda : inp().rstrip() getN = lambda : int(inp()) getNs = lambda : map(int, inp().split()) getList = lambda :list(map(int, inp().split())) getStrs = lambda n : [input() for _ in [0] * n] def yexit(): print("Yes"); exit(0) def nexit(): print("No"); exit(0) pi = 3.141592653589793 mod = 1000000007 MOD = 998244353 INF = 4611686018427387903 dx = [1, 0, -1, 0]; dy = [0, 1, 0, -1] """ Main Code """ h, w = getNs() a = [getList() for _ in [0] * h] dp = [[[0] * 2 for _ in [0] * w] for _ in [0] * h] que = [(0, 0, a[0][0], 0)] while(que): x, y, t, c = que.pop() dp[x][y][c] = t for nx, ny in ((x + 1, y), (x, y + 1)): if not(0 <= nx < h and 0 <= ny < w): continue if(t > a[nx][ny] and t + a[nx][ny] > dp[nx][ny][c]): que.append((nx, ny, t + a[nx][ny], c)) elif(c == 0 and (nx != h - 1 or ny != w - 1) and t > dp[nx][ny][1]): que.append((nx, ny, t, 1)) if(dp[h - 1][w - 1][0] + dp[h - 1][w - 1][1] > 0): yexit() nexit()