import heapq def main(): H, W, Y, X = map(int, input().split()) Y -= 1 # convert to 0-based X -= 1 grid = [] for _ in range(H): grid.append(list(map(int, input().split()))) visited = [[False]*W for _ in range(H)] visited[Y][X] = True current_power = grid[Y][X] heap = [] directions = [ (-1,0), (1,0), (0,-1), (0,1) ] # Initialize the heap with adjacent cells for dy, dx in directions: ny = Y + dy nx = X + dx if 0 <= ny < H and 0 <= nx < W: if not visited[ny][nx] and grid[ny][nx] <= current_power: heapq.heappush(heap, (grid[ny][nx], ny, nx)) required = H * W - 1 # since starting cell is not counted count = 0 while heap: attack, i, j = heapq.heappop(heap) if visited[i][j]: continue if current_power < attack: print("No") return current_power += attack visited[i][j] = True count += 1 # Check adjacent cells for dy, dx in directions: ny = i + dy nx = j + dx if 0 <= ny < H and 0 <= nx < W: if not visited[ny][nx] and grid[ny][nx] <= current_power: heapq.heappush(heap, (grid[ny][nx], ny, nx)) if count == required: print("Yes") else: print("No") if __name__ == "__main__": main()