import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict, Counter import string import random input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') H, W = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(H)] dp = [[[0 for _ in range(W)] for _ in range(H)] for _ in range(2)] dp[1][0][0] = A[0][0] for i in range(H): for j in range(W): if i > 0: if dp[1][i - 1][j] > A[i][j]: dp[1][i][j] = max(dp[1][i][j], dp[1][i - 1][j] + A[i][j]) elif not (i == H - 1 and j == W - 1): dp[0][i][j] = max(dp[0][i][j], dp[1][i - 1][j]) if dp[0][i - 1][j] > A[i][j]: dp[0][i][j] = max(dp[0][i][j], dp[0][i - 1][j] + A[i][j]) if j > 0: if dp[1][i][j - 1] > A[i][j]: dp[1][i][j] = max(dp[1][i][j], dp[1][i][j - 1] + A[i][j]) elif not (i == H - 1 and j == W - 1): dp[0][i][j] = max(dp[0][i][j], dp[1][i][j - 1]) if dp[0][i][j - 1] > A[i][j]: dp[0][i][j] = max(dp[0][i][j], dp[0][i][j - 1] + A[i][j]) print('Yes' if dp[1][H - 1][W - 1] > 0 or dp[0][H - 1][W - 1] > 0 else 'No')