#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>
#include <climits>
#include <cfloat>


using namespace std;

double distance(double x1, double y1, double x2, double y2)
{
	double dx = x1-x2;
	double dy = y1-y2;
	return sqrt(dx*dx+dy*dy);
}

int main()
{
	double x[4], y[4];
	while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf\n"
		, x, y, x+1, y+1, x+2, y+2, x+3, y+3) != EOF)
	{
		double a[2], b[2];
		double dx[2], dy[2];
		for (int i = 0; i < 2; ++i)
		{
			int t = 2*i;
			a[i] = (y[t+1]-y[t])/(x[t+1]-x[t]);
			b[i] = y[t] - a[i]*x[t];
			dx[i] = abs(x[t] - x[t+1]);
			dy[i] = abs(y[t] - y[t+1]);
		}

		bool f1 = dx[0] < 0.001 && dy[1] < 0.001
			|| dx[1] < 0.001 && dx[0] < 0.001;

		double crossX = (b[1] - b[0]) / (a[0] - a[1]);
		double crossY = a[0] * crossX + b[0];

		double t[3];
		t[0] = distance(x[0], y[0], x[2], y[2]);
		t[1] = distance(x[0], y[0], crossX, crossY);
		t[2] = distance(x[2], x[2], crossX, crossY);
		bool f2 = abs(t[0]-sqrt(t[1]*t[1]+t[2]*t[2])) <= 0.001;
		if (f1 || f2)
			puts("YES");
		else
			puts("NO");
	}

	return 0;
}