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