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

int deg[4];

int main() {
	for (int i = 0; i < 3; i++) {
		int x, y;
		cin >> x >> y;
		x--, y--;
		
		deg[x]++;
		deg[y]++;
	}
	
	int odd = 0;
	
	for (int i = 0; i < 4; i++) {
		odd += deg[i] % 2;
	}
	
	puts(odd == 2 || odd == 0 ? "YES" : "NO");
}
