function main(input) {
    const args = input.split(/\n|\s/)
    var count = {'1':0,'2':0,'3':0,'4':0}
    
    for(var a of args){
      count[a]++
    }
  
  for(var b in count){
  if(count[b]>=3) return console.log('NO')
  }
  
  console.log('YES')
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));