There is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will take a look from above and assume that the bottom left corner of the table has coordinates (0, 0), and coordinate axes are left and bottom sides of the table, then the bottom left corner of the white sheet has coordinates (x_1, y_1), and the top right — (x_2, y_2).

After that two black sheets of paper are placed on the table. Sides of both black sheets are also parallel to the sides of the table. Coordinates of the bottom left corner of the first black sheet are (x_3, y_3), and the top right — (x_4, y_4). Coordinates of the bottom left corner of the second black sheet are (x_5, y_5), and the top right — (x_6, y_6). 

<image> Example of three rectangles.

Determine if some part of the white sheet can be seen from the above after the two black sheets are placed. The part of the white sheet can be seen if there is at least one point lying not strictly inside the white sheet and strictly outside of both black sheets.

Input

The first line of the input contains four integers x_1, y_1, x_2, y_2 (0 ≤ x_1 < x_2 ≤ 10^{6}, 0 ≤ y_1 < y_2 ≤ 10^{6}) — coordinates of the bottom left and the top right corners of the white sheet.

The second line of the input contains four integers x_3, y_3, x_4, y_4 (0 ≤ x_3 < x_4 ≤ 10^{6}, 0 ≤ y_3 < y_4 ≤ 10^{6}) — coordinates of the bottom left and the top right corners of the first black sheet.

The third line of the input contains four integers x_5, y_5, x_6, y_6 (0 ≤ x_5 < x_6 ≤ 10^{6}, 0 ≤ y_5 < y_6 ≤ 10^{6}) — coordinates of the bottom left and the top right corners of the second black sheet.

The sides of each sheet of paper are parallel (perpendicular) to the coordinate axes.

Output

If some part of the white sheet can be seen from the above after the two black sheets are placed, print "YES" (without quotes). Otherwise print "NO".

Examples

Input


2 2 4 4
1 1 3 5
3 1 5 5


Output


NO


Input


3 3 7 5
0 0 4 6
0 0 7 4


Output


YES


Input


5 2 10 5
3 1 7 6
8 1 11 7


Output


YES


Input


0 0 1000000 1000000
0 0 499999 1000000
500000 0 1000000 1000000


Output


YES

Note

In the first example the white sheet is fully covered by black sheets.

In the second example the part of the white sheet can be seen after two black sheets are placed. For example, the point (6.5, 4.5) lies not strictly inside the white sheet and lies strictly outside of both black sheets.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	static class Point {
		private int x;
		private int y;

		public Point(int x, int y) {
			this.x = x;
			this.y = y;
		}

		public int getX() {
			return x;
		}

		public int getY() {
			return y;
		}

		@Override
		public String toString() {
			return "Point [x=" + x + ", y=" + y + "]";
		}
		
	}

	static class Edge {
		private Point begin;
		private Point end;
		private boolean vertical = false;

		public Edge(Point begin, Point end) {
			this.begin = begin;
			this.end = end;

			if (begin.getX() == end.getX()) {
				vertical = true;
			} else {
				vertical = false;
			}
		}

		public Point getBegin() {
			return begin;
		}

		public void setBegin(Point begin) {
			this.begin = begin;
		}

		public Point getEnd() {
			return end;
		}

		public void setEnd(Point end) {
			this.end = end;
		}

		public boolean isVertical() {
			return vertical;
		}

		public void setVertical(boolean vertical) {
			this.vertical = vertical;
		}

		@Override
		public String toString() {
			return "Edge [begin=" + begin + ", end=" + end + ", vertical=" + vertical + "]";
		}

	}

	static class Rect {
		private Point leftBottomPoint;
		private Point rightTopPoint;
		private Edge[] edges = new Edge[4];
		private Point leftTopPoint;
		private Point rightBottomPoint;

		public Rect(Point leftBottomPoint, Point rightTopPoint) {
			this.leftBottomPoint = leftBottomPoint;
			this.rightTopPoint = rightTopPoint;
			this.leftTopPoint = new Point(this.leftBottomPoint.getX(), this.rightTopPoint.getY());
			this.rightBottomPoint = new Point(this.rightTopPoint.getX(), this.leftBottomPoint.getY());

			edges = new Edge[4];
			edges[2] = new Edge(leftTopPoint, rightTopPoint);
			edges[3] = new Edge(rightBottomPoint, rightTopPoint);
			edges[0] = new Edge(leftBottomPoint, rightBottomPoint);
			edges[1] = new Edge(leftBottomPoint, leftTopPoint);
		}

		public Rect(int x1, int y1, int x2, int y2) {
			leftBottomPoint = new Point(x1, y1);
			rightTopPoint = new Point(x2, y2);
			leftTopPoint = new Point(x1, y2);
			rightBottomPoint = new Point(x2, y1);

			edges = new Edge[4];
			edges[2] = new Edge(leftTopPoint, rightTopPoint);
			edges[3] = new Edge(rightBottomPoint, rightTopPoint);
			edges[0] = new Edge(leftBottomPoint, rightBottomPoint);
			edges[1] = new Edge(leftBottomPoint, leftTopPoint);
		}

		public Edge getEdge(int i) {
			return this.edges[i];
		}

		public Edge getParrEdge(int i) {
			if (i <= 1) {
				return this.edges[i + 2];
			}
			return this.edges[i - 2];
		}

		public boolean inRect(int x, int y) {

			if (x >= leftBottomPoint.getX() && x <= rightTopPoint.getX() && y >= leftBottomPoint.getY()
					&& y <= rightTopPoint.getY()) {
				return true;
			}

			return false;
		}

		public boolean containEdge(Edge edge) {
			if (edge.vertical) {
				int x = edge.getBegin().getX();
				int y1 = edge.getBegin().getY();
				int y2 = edge.getEnd().getY();

				if ((x >= this.leftBottomPoint.getX() && x <= this.rightTopPoint.getX())
						&& (y1 >= this.leftBottomPoint.getY()
								&& y2 <= this.rightTopPoint.getY())) {
					return true;
				}
				return false;
			} else {
				int y = edge.getBegin().getY();
				int x1 = edge.getBegin().getX();
				int x2 = edge.getEnd().getX();

				if ((x1 >= this.leftBottomPoint.getX() && x2 <= this.rightTopPoint.getX())
						&& (y >= this.leftBottomPoint.getY()
								&& y <= this.rightTopPoint.getY())) {
					return true;
				}
				return false;
			}
		}

		public boolean inRect(Point point) {
			return inRect(point.getX(), point.getY());
		}

		public boolean containRect(Rect other) {
			if (inRect(other.leftBottomPoint) && inRect(other.rightTopPoint)) {
				return true;
			}
			return false;
		}

		public Point getLeftBottomPoint() {
			return leftBottomPoint;
		}

		public void setLeftBottomPoint(Point leftBottomPoint) {
			this.leftBottomPoint = leftBottomPoint;
		}

		public Point getRightTopPoint() {
			return rightTopPoint;
		}

		public void setRightTopPoint(Point rightTopPoint) {
			this.rightTopPoint = rightTopPoint;
		}

		public Edge[] getEdges() {
			return edges;
		}

		public void setEdges(Edge[] edges) {
			this.edges = edges;
		}

		public Point getLeftTopPoint() {
			return leftTopPoint;
		}

		public void setLeftTopPoint(Point leftTopPoint) {
			this.leftTopPoint = leftTopPoint;
		}

		public Point getRightBottomPoint() {
			return rightBottomPoint;
		}

		public void setRightBottomPoint(Point rightBottomPoint) {
			this.rightBottomPoint = rightBottomPoint;
		}

		@Override
		public String toString() {
			return "Rect [leftBottomPoint=" + leftBottomPoint + ", rightTopPoint=" + rightTopPoint
					+ ", edges=" + Arrays.toString(edges) + ", leftTopPoint=" + leftTopPoint
					+ ", rightBottomPoint=" + rightBottomPoint + "]";
		}
		
		

	}

	private static Rect buildRect(BufferedReader in) throws IOException {
		String s = in.readLine();
		String[] word = s.split("\\s+");

		int x1 = Integer.parseInt(word[0]);
		int y1 = Integer.parseInt(word[1]);
		int x2 = Integer.parseInt(word[2]);
		int y2 = Integer.parseInt(word[3]);

		return new Rect(x1, y1, x2, y2);
	}

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		Rect whiteRect = buildRect(in);
		Rect blackRect1 = buildRect(in);
		Rect blackRect2 = buildRect(in);
		
		if( blackRect1.containRect(whiteRect) || blackRect2.containRect(whiteRect)){
			System.out.println("NO");
			return;
		}
		
		Edge[] edges = whiteRect.getEdges();
		boolean contains = false;
		for( int  i = 0 ; i<=1 ; i++ ){
			Edge edge = edges[i];
			Edge parrEdge = edges[2+i];
			
			if( blackRect1.containEdge(edge) 
					&& blackRect2.containEdge(parrEdge) ){
				
				if( i== 0 && blackRect2.getLeftBottomPoint().getY()<=blackRect1.getRightTopPoint().getY() ){
					contains = true;
					System.out.println("NO");
					return;
				}
				if( i==1 && blackRect2.getLeftBottomPoint().getX()<= blackRect1.getRightTopPoint().getX() ){
					contains = true;
					System.out.println("NO");
					return;
				}
				continue;
			}
			else if(  blackRect1.containEdge(parrEdge) 
					&& blackRect2.containEdge(edge) 
					){
				
				if( i== 0 && blackRect1.getLeftBottomPoint().getY()<=blackRect2.getRightTopPoint().getY() ){
					contains = true;
					System.out.println("NO");
					return;
				}
				if( i==1 && blackRect1.getLeftBottomPoint().getX()<= blackRect2.getRightTopPoint().getX() ){
					contains = true;
					System.out.println("NO");
					return;
				}
				continue;
			}
			else{
				continue;
			}
		}
		if(!contains){
			System.out.println("YES");
		}
		
		in.close();

	}

}
