#include <bits/stdc++.h>
using namespace std;
int main(void){
  int n[6];
  for(int i=0; i<6; i++)
    cin>>n[i];
  sort(n,n+6);
  if(n[1]==n[2] && n[3]==n[4])
    cout<<"YES"<<endl;
  else
    cout<<"NO"<<endl;
  return 0;
}
	