#include <iostream>
using namespace std;

int main() {
	int ab, two = 0, three = 0;
	for (int i = 0; i < 6; ++i) {
		cin >> ab;
		if (ab == 2) ++two;
		else if (ab == 3) ++three;
	}
	if (two == 2 && three == 2) cout << "YES";
	else cout << "NO";
}