const main = (inputs) => {
  if (inputs[2] != inputs[3]) {
    console.log('No');
    return false;
  }
  if (inputs[4] != inputs[5]) {
    console.log('No');
    return false;
  }
  if (inputs[2] == inputs[4]) {
    console.log('No');
    return false;
  }
  console.log('Yes');
}
main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));