void main()
{
    int[] path = new int[4];

    foreach (i; 0 .. 3)
    {
        int[] tmp = readln.split.to!(int[]);
        int a = tmp[0] - 1, b = tmp[1] - 1;
        ++path[a], ++path[b];
    }

    writeln(path.all!"a < 3" ? "YES" : "NO");
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;