import std.stdio, std.conv, std.math, std.string, std.range, std.array, std.algorithm, std.typecons;

void main(){
    int[4] m;

    foreach(immutable int i; 0 .. 3) {
        auto buf = readln().strip().split().map!(to!int)();
        m[buf[0]-1] ++;
        m[buf[1]-1] ++;
    }

    foreach(immutable i; m) {
        if(i >= 3) {
            writeln("NO");
            return;
        }
    }

    writeln("YES");
}
