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