print+(join(A,sort<>=~/./g)eq join A,sort<>=~/./g)?YES:NO