#include<iostream>
#include<algorithm>
using  namespace  std;
int  main (){
int  d[10];
for(int  i = 1;  i<= 4;  i++)d[i] = 0;
for(int  i = 0;  i<6;  i++){
int  z;
scanf("%d" , &z );
d[z]++;
}
if(d[1]>=3 || d[2]>=3 || d[3]>=3 || d[4]>=3) printf("NO\n");
else printf("YES\n" );
}