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 i = 3;
 var count = 0;
 var one = lines[0].split(' '); 
 var two = lines[1].split(' ');
 var three = lines[2].split(' ');

 while(lines[i] !== undefined){
    if(one.indexOf(lines[i]) !== -1){
      var index = one.indexOf(lines[i]);
      one[index] = "0";
    }
    if(two.indexOf(lines[i]) !== -1){
      var index = two.indexOf(lines[i]);
      two[index] = "0";
    }
    if(three.indexOf(lines[i]) !== -1){
      var index = three.indexOf(lines[i]);
      three[index] = "0";
    }
    i++;
 }

 if((one[0] == "0" && one[1] == "0" && one[2] == "0") || 
    (two[0] == "0" && two[1] == "0" && two[2] == "0") ||
    (three[0] == "0" && three[1] == "0" && three[2] == "0")){
   count++;
 }
 if((one[0] == "0" && two[0] == "0" && three[0] == "0") || 
    (one[1] == "0" && two[1] == "0" && three[1] == "0") ||
    (one[2] == "0" && two[2] == "0" && three[2] == "0")){
   count++;
 }
 if((one[0] == "0" && two[1] == "0" && three[2] == 0) ||
    (one[2] == "0" && two[1] == "0" && three[0] == 0)){
      count++;
    }

    if(count != 0){
      console.log("Yes");
    }else{
      console.log("No");
    }
 
 
});