#include <iostream>
using namespace std;

int main() {
	int a[3], b[3];
	for(int i=0;i<3;++i) cin>>a[i]>>b[i];
	int p[4] = {0};
	for(int i=0;i<3;++i) p[a[i]-1]++, p[b[i]-1]++;
	bool ok = true;
	for(int i=0;i<4;++i) if(p[i]>=3) ok=false;
	cout<<(ok?"YES":"NO")<<endl;
	return 0;
}