puts'0011233450240360405131416'.index(S=gets.tr("- \n","").chars.sort*'')&&S.size<3?:YES: :NO