H,W = map(int,input().split()) sh,sw,gh,gw = map(int,input().split()) INF = float("inf") maze = [[INF]*(W+2)] memo = [[1 for i in range(W+2)]for j in range(H+2)] def search(stack): lst = [] for j in stack: h,w = j[0],j[1] if h==gh and w==gw: print("YES") exit(0) now = maze[h][w] for i in [[1,0],[0,1],[-1,0],[0,-1]]: nh,nw = h+i[0],w+i[1] if memo[nh][nw] and (maze[nh][nw]==now or maze[nh][nw]==now-1 or maze[nh][nw]==now+1): memo[nh][nw]=0 lst.append([nh,nw]) nnh,nnw = nh+i[0],nw+i[1] if nnh>=0 and nnh<=H and nnw>0 and nnw<=W: if maze[nh][nw]