Arpa is taking a geometry exam. Here is the last problem of the exam.

You are given three points a, b, c.

Find a point and an angle such that if we rotate the page around the point by the angle, the new position of a is the same as the old position of b, and the new position of b is the same as the old position of c.

Arpa is doubting if the problem has a solution or not (i.e. if there exists a point and an angle satisfying the condition). Help Arpa determine if the question has a solution or not.


-----Input-----

The only line contains six integers a_{x}, a_{y}, b_{x}, b_{y}, c_{x}, c_{y} (|a_{x}|, |a_{y}|, |b_{x}|, |b_{y}|, |c_{x}|, |c_{y}| ≤ 10^9). It's guaranteed that the points are distinct.


-----Output-----

Print "Yes" if the problem has a solution, "No" otherwise.

You can print each letter in any case (upper or lower).


-----Examples-----
Input
0 1 1 1 1 0

Output
Yes

Input
1 1 0 0 1000 1000

Output
No



-----Note-----

In the first sample test, rotate the page around (0.5, 0.5) by $90^{\circ}$.

In the second sample test, you can't find any solution.

Difficulty: interview

Starter code:

Solutions:
def read_ints():
	return [int(i) for i in input().split()]

coords = read_ints()
a, b, c = [(coords[i], coords[i + 1]) for i in range(0, len(coords), 2)]
def length_sqr(a, b):
	return (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2

if length_sqr(a, b) != length_sqr(b, c):
	print('No')
elif (c[0] - b[0]) * (b[1] - a[1]) == (c[1] - b[1]) * (b[0] - a[0]):
	print('No')
else:
	print('Yes')

x1, y1, x2, y2, x3, y3 = map(int, input().split())
ab = (x1 - x2) ** 2 + (y1 - y2) ** 2
bc = (x3 - x2) ** 2 + (y3 - y2) ** 2
if (x1 - x2) * (y3 - y2) - (x3 - x2) * (y1 - y2) == 0 or ab != bc:
    print('No')
else:
    print('Yes')

def dist(x1,x2,y1,y2):
	return (x1-x2)**2 + (y1-y2)**2

ax,ay,bx,by,cx,cy = map(int,input().split())
if ((by-ay)*(cx-bx) == (cy-by)*(bx-ax)):
	print('No')
else:
	if(dist(ax,bx,ay,by) == dist(bx,cx,by,cy)):
		print('Yes')
	else:
		print('No')

ax,ay,bx,by,cx,cy = map(int,input().split())

dx1, dy1 = ax-bx, ay-by
dx2, dy2 = bx-cx, by-cy

# parallel
if dx1*dy2 == dx2*dy1 or dx1**2+dy1**2 != dx2**2+dy2**2:
  print('No')
else:
  print('Yes')

from math import sqrt

ax,ay,bx,by,cx,cy = [int(i) for i in input().split()]
if (ax-bx)**2+(ay-by)**2 != (bx-cx)**2+(by-cy)**2:
    print("No")
elif abs((ax-bx)*(bx-cx)+((ay-by)*(by-cy)))**2== ((ax-bx)**2+(ay-by)**2)* ((bx-cx)**2+(by-cy)**2):
    print("No")
else:
    print("Yes")

ax, ay, bx, by, cx, cy = map(int, input().split())
ux = cx - bx
uy = cy - by
vx = bx - ax
vy = by - ay

if uy*vx == vy*ux or ux**2 + uy**2 != vx**2 + vy**2:
	print("No") 
else:
	print("Yes")

import sys
ax,ay,bx,by,cx,cy=map(int,input().split())
if (ax-bx)**2+(ay-by)**2==(bx-cx)**2+(by-cy)**2 and (by-ay)*(cx-bx)!=(cy-by)*(bx-ax):
    print ("Yes")
else:
    print ("No")

ax, ay, bx, by, cx, cy = map(int, input().split())

if (ax - bx) * (cy - by) == (ay - by) * (cx - bx):
	print('No')
elif ((ax - bx) ** 2 + (ay - by) ** 2) == ((bx - cx) ** 2 + (by - cy) ** 2):
	print("Yes")
else:
	print("No")

ax,ay,bx,by,cx,cy = list(map(int, input().split()))

abx = (ax-bx)
aby = (ay-by)
cbx = (cx-bx)
cby = (cy-by)

cross = abx*cby - aby*cbx

if ((ax-bx)**2 + (ay-by)**2) == (bx-cx)**2 + (by-cy)**2 and cross != 0:
    print("Yes")
else:
    print("No")


ax, ay, bx, by, cx, cy = list(map(int, input().split()))

def r(x1, y1, x2, y2):
    return (x1 - x2) ** 2 + (y1 - y2) ** 2

def line(x3, y3, x1, y1, x2, y2):
    if (x3 - x1) * (y2 - y1) == (y3 - y1) * (x2 - x1):
        return True
    return False

if r(ax, ay, bx, by) == r(bx, by, cx, cy) and not line(ax, ay, bx, by, cx, cy):
    print('Yes')
else:
    print('No')
          


x1, y1, x2, y2, x3, y3 = list(map(int, input().split(' ')))

def main():
    b1 = (x2 - x1) ** 2 + (y2 - y1) ** 2 == (x3 - x2) ** 2 + (y3 - y2) ** 2
    b2 = (y3 - y1) * (x2 - x1) != (y2 - y1) * (x3 - x1)

    return b1 and b2

print('Yes' if main() else 'No')


a, b, c, d, e, f = map(int, input().split())
k = (c - e) ** 2 + (d - f) ** 2
#print(k, (a - e) ** 2 + (b - f) ** 2)
if (a - c) ** 2 + (b - d) ** 2 == k and (a - e) ** 2 + (b - f) ** 2 != k * 4:
    print("Yes")
else:
    print("No")

def get_len_sq(a, b):
    return (a[0] - b[0])**2 + (a[1] - b[1])**2


ax, ay, bx, by, cx, cy = list(map(int, input().split()))
a = (ax, ay)
b = (bx, by)
c = (cx, cy)
f = get_len_sq
if f(a,b) == f(b,c):
    if a[0]+c[0] == 2*b[0] and a[1]+c[1] == 2*b[1]:
        print('No')
    else:
        print('Yes')
else:
    print('No')


def readln(): return list(map(int, input().rstrip().split()))


ax, ay, bx, by, cx, cy = readln()
dab = (bx - ax) ** 2 + (by - ay) ** 2
dbc = (cx - bx) ** 2 + (cy - by) ** 2

if dab != dbc:
    print('No')
    return

if (by - ay) * (cx - bx) == (cy - by) * (bx - ax):
    print('No')
    return

print('Yes')


ax, ay, bx, by, cx, cy = input().split()
ax, ay, bx, by, cx, cy = int(ax), int(ay), int(bx), int(by), int(cx), int(cy)

lAB = (bx - ax)**2 + (by - ay)**2
lBC = (cx - bx)**2 + (cy - by)**2

if lAB == lBC and (by - ay)*(cx - bx) != (cy - by)*(bx - ax):
    print("Yes")
else:
    print("No")


l = list([int(x) for x in input().split()])
ax, ay, bx, by, cx, cy = l
d1 = (ax - bx) ** 2 + (ay - by) ** 2
d2 = (cx - bx) ** 2 + (cy - by) ** 2
same_line = cx * (by - ay) - cy * (bx - ax) == ax * by - bx * ay
print("Yes" if (d1 == d2 and not same_line) else "No")


def isTria(a,b,c,d,e,f):
    if abs(a*d-b*c+c*f-d*e+e*b-a*f) == 0:
        return 0
    else:
        return 1

def length(a,b,c,d):
    return (d-b)**2+(c-a)**2

ax,ay,bx,by,cx,cy=list(map(int,input().split()))
if not isTria(ax,ay,bx,by,cx,cy):
    print('No')
else:
    if length(ax,ay,bx,by) == length(bx,by,cx,cy):
        print('Yes')
    else:
        print('No')


ax,ay,bx,by,cx,cy = map(int,input().split())
ab2 = (ax-bx)**2+(ay-by)**2
bc2 = (bx-cx)**2+(by-cy)**2
ans = (ab2==bc2) and ((cy-by)*(bx-ax)!=(by-ay)*(cx-bx))
print("Yes") if ans else print("No")

ax, ay, bx, by, cx, cy = map(int, input().split())
Bab = ax - bx
Aab = by - ay
Cab = -1 * Aab * ax - Bab * ay
if Aab * cx + Bab * cy + Cab == 0:
    print("No")
else:
    ab = (ax - bx) ** 2 + (ay - by) ** 2
    ac = (ax - cx) ** 2 + (ay - cy) ** 2
    bc = (by - cy) ** 2 + (bx - cx) ** 2
    if ab == bc:
        print("Yes")
    else:
        print("No")

from math import *

ax, ay, bx, by, cx, cy = list(map(int, input().split()))

l1 = (bx - ax)**2 + (by - ay)**2
l2 = (cx - bx)**2 + (cy - by)**2
dx = bx - ax
dy = by - ay

if l1 != l2:
    print('No')
elif cx == bx + dx and cy == by + dy:
    print('No')
else:
    print('Yes')




from math import fabs


EPS = 10 ** -6

def equal(a, b):
    return fabs(a - b) < EPS


def dist_sq(ax, ay, bx, by):
    return (ax - bx) * (ax - bx) + (ay - by) * (ay - by)


def triangle_area(ax, ay, bx, by, cx, cy):
    return ax * (by - cy) + bx * (cy - ay) + cx * (ay - by)


def main():
    ax, ay, bx, by, cx, cy = (int(x) for x in input().split())

    if (equal(dist_sq(ax, ay, bx, by), dist_sq(bx, by, cx, cy)) and
        not equal(triangle_area(ax, ay, bx, by, cx, cy), 0.0)):
            print("Yes")
    else:
        print("No")


def __starting_point():
    main()

__starting_point()