H,W = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(H)] if not(1<=H<=500 and 1<=W<=500 and len(A)==H): exit() for a in A: if not (len(a)==W and 1<=min(a) and max(a)<=10**9): exit() DP = [[[0]*2 for _ in range(W)]for _ in range(H)] DP[0][0][0]=A[0][0] for h in range(H): for w in range(W): if h+1A[h+1][w]: DP[h+1][w][0]=max(DP[h+1][w][0],DP[h][w][0]+A[h+1][w]) if w+1A[h][w+1]: DP[h][w+1][0]=max(DP[h][w+1][0],DP[h][w][0]+A[h][w+1]) if h+1A[h+1][w]: DP[h+1][w][1]=max(DP[h+1][w][1],DP[h][w][1]+A[h+1][w]) if w+1A[h][w+1]: DP[h][w+1][1]=max(DP[h][w+1][1],DP[h][w][1]+A[h][w+1]) if h+1A[H-1][W-1]: print('Yes') else: print('No')