def main():
    coo = [] #Coordenadas
    dia = 0 #Segmentos diagonales
    for i in range(4):
        x1, y1, x2, y2 = map(int, input().split())
        coo.append([x1,y1])
        coo.append([x2,y2])
        
        if x1 != x2 and y1 != y2: dia += 1 #Si hay segmentos diagonales agrega 1 al contador
        
    counts = [] # Contamos la cantidad de veces que las coordenadas están repetidas
    for i in coo: counts.append(coo.count(i))
    
    med = [] #Sacamos el largo de cada segmento
    for i in range(4):
        hyp = ((coo[i*2][0]-coo[(i*2)+1][0])**2 + (coo[i*2][1]-coo[(i*2)+1][1])**2)**0.5
        med.append(hyp)
            
    if sum(counts) == 16 and counts.count(counts[0]) == 8 and dia == 0: #Tienen cuatro vertices
        if med.count(med[0]) == 4: print("YES") #Si es un cuadrado
        elif med.count(med[0]) == 2 and med.count(med[1]) == 2 and med.count(med[2]) == 2: print("YES") #Si es un rectángulo
        else: print("NO") #Si es otra cosa       
    else: print("NO")
        
        
if __name__ == "__main__":
    main()