function Main(input) {
    var input = input.split("\n");
    var an = true;
    var one = 0;
    var two = 0;
    var three = 0;
    var four = 0;
    t = 0;
    for(i = 0; i < 3; i++){
        n = input[i].split(" ");
        n[0] = Number(n[0]);n[1] = Number(n[1]);
        if(n[0] === 1) one++;
        else if(n[0] === 2) two++;
        else if(n[0] === 3) three++;
        else if(n[0] === 4) four++;
        if(n[1] === 1) one++;
        else if(n[1] === 2) two++;
        else if(n[1] === 3) three++;
        else if(n[1] === 4) four++;
    }
    if(one > 2 || two > 2 || three > 2 || four > 2) an = false;
    if(an) console.log("YES");
    else console.log("NO")
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));