from collections import Counter
puntos = Counter()
segmentos = Counter()

for _ in range(4):
    px, py, qx, qy = list(map(int, input().split()))
    p = (px, py)
    q = (qx, qy)
    puntos[p] += 1
    puntos[q] += 1
    segmentos[(p, q)] += 1

if len(puntos) == 4 and len(segmentos) == 4:    
    v, h = 0, 0 
    for L in segmentos:
        p, q = L[0], L[1]
        if p == q:    
            print("NO")  # si un segmento es un punto imprime no
            break  
        else:  
            px, py = p[0], p[1] 
            qx, qy = q[0], q[1]
            if qx - px == 0:  
                v += 1
            elif qy - py == 0:
                h += 1
            else:
                print('NO')  # segmento no es horizontal ni vertical
                break
    if v == 2 and h == 2:
        print('YES') 
else:   
    print('NO')      # puntos distinto de 4
   	  					  	 	    	 	 				 		