n=input() p=["c","d","f","h","bb","bd","bh","bj","cd","cj","db","dh","eb","ed","eh","fd","fj","gb","gh","hb","hd","hj","id","ij","jh","bab","bad","bah","baj","bbd","bch","bdb","bdh","bdj","bej","bfb","bfh","bgd","bgh","bhd","bhj","bib","bjb","bjd","bjh","bjj","cbb","ccd","cch","ccj","cdd","cdj","ceb","cfb","cfh","cgd","cgj","chb","chh","cib","cid","cjd","dah","dbb","dbd","dbh","ddb","ddh","deh","dej","dfd","dfj","dgh","dhd","dhj","did","dij","djh","eab","eaj","ebj","ecb","edb","edd","edj","eed","eej","efh","egb","egd","egh","ehj","eih","ejb","ejj","fad","faj","fcb","fcd","feb","feh","ffh","fgd","fgj","fhb","fhh","fih","fjd","fjj","gab","gah","gbd","gbh","gbj","gdb","geb","ged","geh","gfd","gfj","ggb","ghd","ghh","gid","gjb","hab","haj","hbj","hch","hdd","hdj","hed","hfb","hfh","hgb","hgj","hhd","hih","hjh","iaj","ibb","icb","icd","ich","icj","idj","ifd","ifh","ifj","igd","ihh","iib","iid","iih","jah","jbb","jbj","jcj","jdh","jeb","jeh","jfd","jgh","jhb","jhh","jid","jjb","jjh"] l="abcdefghij" print("YES" if n.translate(str.maketrans("".join([str(ord("a")-ord(c)) for c in l]).replace("-", ""), l)) in p else "NO")