#include<iostream>
using namespace std;
struct line{
int a,b,c,d;
}t[100005];
bool c=1;
int main(){
for(int i=1;i<=4;i++){
cin>>t[i].a>>t[i].b>>t[i].c>>t[i].d;
if(!((t[i].b==t[i].d)or(t[i].a==t[i].c))){
c=0;
}
if(t[i].a==t[i].c and t[i].b==t[i].d)c=0;
}
for(int i=1;i<=4;i++){
int x=0,y=0;
for(int j=1;j<=4;j++){
if(j!=i){
if(t[i].a==t[j].c and t[i].b==t[j].d)x++;
if(t[i].a==t[j].a and t[i].b==t[j].b)x++;}
}
for(int j=1;j<=4;j++){
if(j!=i){
if(t[i].c==t[j].c and t[i].d==t[j].d)y++;
if(t[i].c==t[j].a and t[i].d==t[j].b)y++;}
}
if(x!=1 or y!=1)c=0;
}
if(c)cout<<"YES";
else cout<<"NO";
return 0;
}