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