#include<iostream>
using namespace std;
int main() {
 int a[5]={0};
  
  int b;
  int i=1;
  while (i<7) {
    cin >> b;
    a[b]=a[b]+1;
    
    i=i+1;
  }
  
  if (a[1]<3 && a[2]<3 && a[3]<3 && a[4]<3) cout << "YES";
  else cout << "NO";
  cout << endl;
  
  
  
}
