import java.util.ArrayDeque; import java.util.Date; import java.util.Queue; import java.util.Scanner; public class main{ static class snow{ int x,y,z; snow(int x,int y,int z){ this.x=x; this.y=y; this.z=z; } } static int[] dx={1,0,-1,0}; static int[] dy={0,1,0,-1}; public static void main(String[] args){ Scanner sc=new Scanner(System.in); long exec_time=new Date().getTime(); int h=sc.nextInt(); int w=sc.nextInt(); int a=sc.nextInt(); int si=sc.nextInt(); int sj=sc.nextInt(); int b=sc.nextInt(); int gi=sc.nextInt(); int gj=sc.nextInt(); boolean[][] map=new boolean[h][w]; for(int i=0;i q=new ArrayDeque<>(); q.add(new snow(si,sj,a)); int count=0; while(!q.isEmpty()){ snow now=q.poll(); count++; if(count>300000)break; if(now.x==gi&&now.y==gj&&now.z==b){ System.out.println("Yes"); return; } for(int i=0;i<4;i++){ int nextx=now.x+dx[i]; int nexty=now.y+dy[i]; if(nextx>=0&&nextx=0&&nexty50000||used[nextx][nexty][nextz])continue; q.add(new snow(nextx,nexty,nextz)); used[nextx][nexty][nextz]=true; } } } System.out.println("No"); System.err.println(new Date().getTime()-exec_time+"ms"); } }