char i[4]; int main(){ gets(gets(i)); if(i[4]>10||i[0]==i[1]||i[1]==i[2])puts("YES"); puts("NO"); return 0; }