import sys input = sys.stdin.readline H,W=map(int,input().split()) A=[list(map(int,input().split())) for i in range(H)] DP=[[-1]*W for i in range(H)] DP2=[[-1]*W for i in range(H)] DP[0][0]=A[0][0] for i in range(H): for j in range(W): if DP[i][j]==-1: continue if i+1A[-1][-1] or DP2[H-2][W-1]>A[-1][-1] or DP[H-1][W-2]>A[-1][-1] or DP2[H-1][W-2]>A[-1][-1]: print("Yes") else: print("No")