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

int deg[5];

int main()
{
	for (int i = 0; i < 3; i++) {
		int a, b;
		cin >> a >> b;
		deg[a]++;
		deg[b]++;
	}
	for (int v = 1; v <= 4; v++) {
		if (deg[v] == 3) {
			cout << "NO\n";
			return 0;
		}
	}
	cout << "YES\n";
}
