#include <iostream>
using namespace std;

int a[4]={0};
int main(void){
	for(int i=0; i<3; i++){
		int x, y;
		cin >> x >> y;
		a[x-1]++;
		a[y-1]++;
	}
	if(a[0]==0||a[1]==0||a[2]==0||a[3]==0||a[0]==3||a[1]==3||a[2]==3||a[3]==3) cout << "NO" << endl;
	else cout << "YES" << endl;
}