import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class P14C {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(in, out);
		out.close();
	}

	static class Task {
		private class Segment {
			private class Point {
				int x, y;

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

			Point p1, p2;

			public Segment(int x1, int y1, int x2, int y2) {
				this.p1 = new Point(x1, y1);
				this.p2 = new Point(x2, y2);
				if ((p1.x == p2.x && p1.y > p2.y) || (p1.y == p2.y && p1.x > p2.x)) {
					Point temp = p1;
					p1 = p2;
					p2 = temp;
				}
			}
		}

		public void solve(InputReader in, PrintWriter out) {
			int hor = 0;
			int vert = 0;
			Segment a = null, b = null, c = null, d = null;
			for (int i = 0; i < 4; i++) {
				int x1 = in.nextInt(), y1 = in.nextInt(), x2 = in.nextInt(), y2 = in.nextInt();
				Segment s = new Segment(x1, y1, x2, y2);
				if (hor < 2 && y1 == y2) {
					if (hor == 0) {
						b = s;
					} else {
						a = s;
					}
					hor++;
				} else if (vert < 2 && x1 == x2) {
					if (vert == 0) {
						d = s;
					} else {
						c = s;
					}
					vert++;
				} else {
					out.println("NO");
					return;
				}
			}
			if (a == null || b == null || c == null || d == null) {
				out.println("NO");
				return;
			}
			if (b.p1.y < a.p1.y) {
				Segment temp = a;
				a = b;
				b = temp;
			}
			if (d.p1.x < c.p1.x) {
				Segment temp = c;
				c = d;
				d = temp;
			}
			boolean validac = a.p1.x == c.p1.x && a.p1.y == c.p1.y;
			boolean validad = a.p2.x == d.p1.x && a.p2.y == d.p1.y;
			boolean validbc = c.p2.x == b.p1.x && c.p2.y == b.p1.y;
			boolean validbd = b.p2.x == d.p2.x && b.p2.y == d.p2.y;
			if (validac && validad && validbc && validbd) {
				out.println("YES");
			} else {
				out.println("NO");
			}
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}

	}

}
