/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { // your code goes here BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] lines = br.readLine().split(" "); int h = Integer.parseInt(lines[0]); int w = Integer.parseInt(lines[1]); lines = br.readLine().split(" "); int sh = Integer.parseInt(lines[0])-1; int sw = Integer.parseInt(lines[1])-1; int gh = Integer.parseInt(lines[2])-1; int gw = Integer.parseInt(lines[3])-1; int[][] map = new int[h][w]; boolean[][] visit = new boolean[h][w]; for(int i=0;i deq = new ArrayDeque(); Pair start = new Pair(sh,sw); Pair goal = new Pair(gh,gw); deq.add(start); visit[sh][sw] = true; start:while(!deq.isEmpty()){ Pair p = deq.removeFirst(); for(Pair next:getNext(map,p)){ if(visit[next.h][next.w] == false){ visit[next.h][next.w] = true; if(next.equals(goal)){ break start; } deq.add(next); } } } System.out.println(visit[gh][gw]?"YES":"NO"); } static private ArrayList getNext(int[][] map,Pair p){ int now_height = map[p.h][p.w]; ArrayList ret = new ArrayList(); for(Pair next:Pair.nexts){ try{ if(Math.abs(map[p.h+next.h][p.w+next.w] - now_height) <= 1){ ret.add(new Pair(p.h+next.h,p.w+next.w)); } if( map[p.h+next.h][p.w+next.w] < now_height && map[p.h+next.h*2][p.w+next.w*2] == now_height){ ret.add(new Pair(p.h+next.h*2,p.w+next.w*2)); } }catch(Exception e){} } return ret; } private static class Pair{ static Pair[] nexts = new Pair[]{new Pair(1,0),new Pair(0,1),new Pair(-1,0),new Pair(0,-1)}; public int h; public int w; public Pair(int h,int w){ this.h = h; this.w = w; } public boolean equals(Pair p){ return this.h==p.h && this.w == p.w; } public String toString(){ return new StringBuilder().append(h).append(",").append(w).toString(); } } }