process.stdin.resume();
process.stdin.setEncoding('utf8');
var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
 var road_1 = lines[0].split(' ');
 var road_2 = lines[1].split(' ');
 var road_3 = lines[2].split(' ');
var arr = new Array(6);
arr [0] = parseInt(road_1[0]);
arr [1] = parseInt(road_1[1]);
arr [2] = parseInt(road_2[0]);
arr [3] = parseInt(road_2[1]);
arr [4] = parseInt(road_3[0]);
arr [5] = parseInt(road_3[1]);
var cnt = new Array(4).fill(0);
// console.log(arr);
 for (var i = 0 ; i < 6 ; i++) {
var num = arr[i] - 1;
cnt[num] += 1 ;
}
// console.log(cnt);
if (cnt[0] > 2 || cnt[1] > 2 || cnt[2] > 2 || cnt[3] > 2) {
console.log("NO")
} else {
console.log("YES")
}

});