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

int u, v, d[4];

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	for (int i = 0; i < 3; i++)
		cin >> u >> v, d[--u]++, d[--v]++;
	sort(d, d + 4);
	cout << (d[0] == 1 && d[1] == 1 && d[2] == 2 && d[3] == 2? "YES": "NO");
	return 0;
}