a[99],i;main(){for(*a=-2;~(a[getchar()+1]+=1-a[11]*2););i=!puts(~*a?"NO":"YES");}