import java.io.*;
import java.util.*;

public class cake_nn {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(new File("cake.in"));
		PrintWriter out = new PrintWriter("cake.out");
		sc.next();
		long[] x = new long[4];
		long[] y = new long[4];
		for (int i = 0; i < 4; i++) {
			x[i] = sc.nextLong();
			y[i] = sc.nextLong();
		}
		long[] vx = new long[4];
		long[] vy = new long[4];
		all: for (int it = 0; it < 4; it++) {
			vx[0] = x[it];
			vy[0] = y[it];
			for (int i = 1; i < 4; i++) {
				vx[i] = -vy[i - 1];
				vy[i] = vx[i - 1];
			}
			int[] theSame = new int[4];
			for (int i = 0; i < 4; i++) {
				for (int j = 0; j < 4; j++) {
					if (vect(x[i], y[i], vx[j], vy[j]) == 0
							&& sign(x[i]) == sign(vx[j])
							&& sign(y[i]) == sign(vy[j])) {
						theSame[j]++;
					}
				}
			}
			for (int i : theSame) {
				if (i > 1) {
					continue all;
				}
			}
			int[] contains = new int[4];
			for (int i = 0; i < 4; i++) {
				for (int j = 0; j < 4; j++) {
					if (vect(x[i], y[i], vx[j], vy[j]) < 0
							&& scalar(x[i], y[i], vx[j], vy[j]) > 0) {
						contains[j]++;
					}
				}
			}
			for (int i : contains) {
				if (i > 1) {
					continue all;
				}
			}
			for (int i = 0; i < 4; i++) {
				if (contains[i] > 0) {
					continue;
				}
				if (theSame[i] == 0 && theSame[(i + 1) % 4] == 0) {
					continue all;
				}
			}
			for (int i = 0; i < 4; i++) {
				if (theSame[i] > 0) {
					if (contains[i] > 0 && contains[(i + 3) % 4] > 0) {
						continue all;
					}
				}
			}
			// System.err.println(Arrays.toString(theSame));
			// System.err.println(Arrays.toString(contains));
			out.println("YES");
			out.close();
			return;
		}
		out.println("NO");
		sc.close();
		out.close();
	}

	static long scalar(long x1, long y1, long x2, long y2) {
		return x1 * x2 + y1 * y2;
	}

	static long vect(long x1, long y1, long x2, long y2) {
		return x1 * y2 - y1 * x2;
	}

	static int sign(long x) {
		return x < 0 ? -1 : x > 0 ? 1 : 0;
	}
}
