#include <bits/stdc++.h>
using namespace std;

int main(){
	int a[5],ans=0;
	int x,y;
	for(int i=0;i<3;i++){
		cin>>x>>y;
		a[x]++;
		a[y]++;
	}
	for(int i=1;i<=4;i++){
		if(a[i]==0){
			cout<<"NO\n";
			return 0;
		}
		if(a[i]%2==1) ans++;
	}
	if(ans<=2) cout<<"YES\n";
	else cout<<"NO\n";
	return 0;
}
