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

void main() {
    struct Path { long begin, end; }
    Path[] pathList;
    foreach (i; 0..3) {
        const tmp = readln.split.to!(long[]);
        pathList ~= Path(tmp[0], tmp[1]);
    }
    foreach (start; 1..5) {
        auto routeIndexList = [0,1,2];
        bool[4] flag;
        do {
            long current = start;
            bool ok = true;
            foreach (i; 0..3) {
                const path = pathList[routeIndexList[i]];
                if (path.begin == current) {
                    current = path.end;
                } else if (path.end == current) {
                    current = path.begin;
                } else {
                    ok = false;
                    break;
                }
            }
            if (ok) {
                writeln("YES");
                return;
            }
        } while(routeIndexList.nextPermutation);
    }
    writeln("NO");
}

