#!/usr/bin/env PyPy3 from collections import Counter, defaultdict, deque import itertools import re import math from functools import reduce import operator import bisect from heapq import * import functools mod=998244353 import sys input=sys.stdin.readline h,w=map(int,input().split()) a=[list(map(int,input().split())) for _ in range(h)] dp = [[[-1] * 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): if i == 0 and j == 0: continue if i != 0: if dp[0][i-1][j] > a[i][j]: dp[0][i][j] = dp[0][i-1][j] + a[i][j] elif dp[0][i-1][j] != -1: dp[1][i][j] = dp[0][i-1][j] if dp[1][i-1][j] > a[i][j]: dp[1][i][j] = max(dp[1][i-1][j] + a[i][j],dp[1][i][j]) if j != 0: if dp[0][i][j-1] > a[i][j]: dp[0][i][j] = max(dp[0][i][j-1] + a[i][j],dp[0][i][j]) elif dp[0][i][j-1] != -1: dp[1][i][j] = max(dp[0][i][j-1],dp[1][i][j]) if dp[1][i][j-1] > a[i][j]: dp[1][i][j] = max(dp[1][i][j-1] + a[i][j],dp[1][i][j]) if dp[0][-1][-1] > a[-1][-1] or dp[1][-1][-1] > a[-1][-1]: print('Yes') else: print('No')