"use strict";const main=e=>{let t=e.split("\n"),n=[];for(let e=0;e<3;e++)n.push(t[e].split(/\s/).map(e=>e-0));let s=[0,0,0,0,0];for(let e=0;e<3;e++)s[n[e][0]]+=1,s[n[e][1]]+=1;console.log(s.every(function(e){return 3!=e})?"YES":"NO")};main(require("fs").readFileSync("/dev/stdin","utf8"));