'use strict'
function main(input) {
var counter = function(str,seq){
    return str.split(seq).length - 1;
}
 
var str = input;
 
var A = counter(str,"A"); 
var B = counter(str,"B"); 
var C = counter(str,"C"); 
var D = counter(str,"D");

  
if (A==1||B==1||C==1||D==1){
  console.log("NO")
}else{
  console.log("YES")
}
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));